Skip to content

Commit 9a3586a

Browse files
committed
Bump to 2021 edition, inline formats, lints
* 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
1 parent 9d93636 commit 9a3586a

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

bb8/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.8.0"
44
description = "Full-featured async (tokio-based) connection pool (like r2d2)"
55
license = "MIT"
66
repository = "https://github.com/djc/bb8"
7-
edition = "2018"
7+
edition = "2021"
88
workspace = ".."
99
readme = "../README.md"
1010

bb8/src/api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ where
382382
{
383383
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
384384
match *self {
385-
RunError::User(ref err) => write!(f, "{}", err),
385+
RunError::User(ref err) => write!(f, "{err}"),
386386
RunError::TimedOut => write!(f, "Timed out in bb8"),
387387
}
388388
}

postgres/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.8.1"
44
description = "Full-featured async (tokio-based) postgres connection pool (like r2d2)"
55
license = "MIT"
66
repository = "https://github.com/djc/bb8"
7-
edition = "2018"
7+
edition = "2021"
88

99
[features]
1010
"with-bit-vec-0_6" = ["tokio-postgres/with-bit-vec-0_6"]

postgres/examples/hyper.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async fn main() {
2222

2323
let pool = match Pool::builder().build(pg_mgr).await {
2424
Ok(pool) => pool,
25-
Err(e) => panic!("bb8 error {}", e),
25+
Err(e) => panic!("bb8 error {e}"),
2626
};
2727

2828
let _ = Server::bind(&addr)
@@ -40,7 +40,7 @@ async fn main() {
4040
}
4141
Err(e) => {
4242
println!("Sending error response");
43-
Response::new(Body::from(format!("Internal error {:?}", e)))
43+
Response::new(Body::from(format!("Internal error {e:?}")))
4444
}
4545
})
4646
}
@@ -57,5 +57,5 @@ async fn handler(
5757
let stmt = conn.prepare("SELECT 1").await?;
5858
let row = conn.query_one(&stmt, &[]).await?;
5959
let v = row.get::<usize, i32>(0);
60-
Ok(Response::new(Body::from(format!("Got results {:?}", v))))
60+
Ok(Response::new(Body::from(format!("Got results {v:?}"))))
6161
}

postgres/examples/static_select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async fn main() {
1717

1818
let pool = match Pool::builder().build(pg_mgr).await {
1919
Ok(pool) => pool,
20-
Err(e) => panic!("builder error: {:?}", e),
20+
Err(e) => panic!("builder error: {e:?}"),
2121
};
2222

2323
let connection = pool.get().await.unwrap();

redis/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.11.0"
44
description = "Full-featured async (tokio-based) redis connection pool (like r2d2)"
55
license = "MIT"
66
repository = "https://github.com/djc/bb8"
7-
edition = "2018"
7+
edition = "2021"
88

99
[dependencies]
1010
async-trait = "0.1"

0 commit comments

Comments
 (0)