Skip to content

Commit 4c63df4

Browse files
committed
chore: updates for clippy lints
1 parent 7be5844 commit 4c63df4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples/diesel_embedded/src/main.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
#![forbid(clippy::allow_attributes)]
33
#![deny(clippy::pedantic)]
44

5+
use crate::models::{NewPost, Post};
56
use diesel::r2d2::{ConnectionManager, Pool};
6-
use diesel::PgConnection;
7+
use diesel::{PgConnection, RunQueryDsl, SelectableHelper};
78
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
89
use postgresql_embedded::{PostgreSQL, Result, Settings, VersionReq};
10+
911
mod models;
1012
pub mod schema;
1113

12-
use self::models::*;
13-
use diesel::prelude::*;
14-
1514
const MIGRATIONS: EmbeddedMigrations = embed_migrations!("./migrations/");
1615
#[tokio::main]
1716
async fn main() -> Result<()> {
@@ -52,6 +51,10 @@ async fn main() -> Result<()> {
5251
postgresql.stop().await
5352
}
5453

54+
/// Create a new post
55+
///
56+
/// # Panics
57+
/// if the post cannot be saved
5558
pub fn create_post(conn: &mut PgConnection, title: &str, body: &str) -> Post {
5659
use crate::schema::posts;
5760

postgresql_embedded/src/settings.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ impl Settings {
135135
/// # Errors
136136
///
137137
/// Returns an error if the URL is invalid.
138-
#[expect(irrefutable_let_patterns)]
139138
pub fn from_url<S: AsRef<str>>(url: S) -> Result<Self> {
140139
let parsed_url = match Url::parse(url.as_ref()) {
141140
Ok(parsed_url) => parsed_url,

0 commit comments

Comments
 (0)