Skip to content

Commit

Permalink
Bump to 2021 edition, inline formats, lints
Browse files Browse the repository at this point in the history
* Bump Rust edition 2018 -> 2021
* Use new inline formatting, i.e. `format!("{v}")` instead of `format!("{}", v)` (simple cases only)
* use more specific asserts like `assert_ne!`
* ignore intellij IDE files
* remove a few un-needed namespace prefixes
  • Loading branch information
nyurik authored and djc committed Aug 1, 2022
1 parent facf952 commit 92306cb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bb8/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.8.0"
description = "Full-featured async (tokio-based) connection pool (like r2d2)"
license = "MIT"
repository = "https://github.com/djc/bb8"
edition = "2018"
edition = "2021"
workspace = ".."
readme = "../README.md"

Expand Down
2 changes: 1 addition & 1 deletion bb8/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ where
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
RunError::User(ref err) => write!(f, "{}", err),
RunError::User(ref err) => write!(f, "{err}"),
RunError::TimedOut => write!(f, "Timed out in bb8"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.8.1"
description = "Full-featured async (tokio-based) postgres connection pool (like r2d2)"
license = "MIT"
repository = "https://github.com/djc/bb8"
edition = "2018"
edition = "2021"

[features]
"with-bit-vec-0_6" = ["tokio-postgres/with-bit-vec-0_6"]
Expand Down
6 changes: 3 additions & 3 deletions postgres/examples/hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn main() {

let pool = match Pool::builder().build(pg_mgr).await {
Ok(pool) => pool,
Err(e) => panic!("bb8 error {}", e),
Err(e) => panic!("bb8 error {e}"),
};

let _ = Server::bind(&addr)
Expand All @@ -40,7 +40,7 @@ async fn main() {
}
Err(e) => {
println!("Sending error response");
Response::new(Body::from(format!("Internal error {:?}", e)))
Response::new(Body::from(format!("Internal error {e:?}")))
}
})
}
Expand All @@ -57,5 +57,5 @@ async fn handler(
let stmt = conn.prepare("SELECT 1").await?;
let row = conn.query_one(&stmt, &[]).await?;
let v = row.get::<usize, i32>(0);
Ok(Response::new(Body::from(format!("Got results {:?}", v))))
Ok(Response::new(Body::from(format!("Got results {v:?}"))))
}
2 changes: 1 addition & 1 deletion postgres/examples/static_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() {

let pool = match Pool::builder().build(pg_mgr).await {
Ok(pool) => pool,
Err(e) => panic!("builder error: {:?}", e),
Err(e) => panic!("builder error: {e:?}"),
};

let connection = pool.get().await.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.11.0"
description = "Full-featured async (tokio-based) redis connection pool (like r2d2)"
license = "MIT"
repository = "https://github.com/djc/bb8"
edition = "2018"
edition = "2021"

[dependencies]
async-trait = "0.1"
Expand Down

0 comments on commit 92306cb

Please sign in to comment.