Skip to content

Commit 1b40972

Browse files
committed
Fix clippy::uninlined_format_args
There are a lot of changes, but they are fully mechanical, performed by clippy itself using `cargo clippy --all-targets --fix --allow-dirty` after I fixed first three occurrences myself.
1 parent 7d1f453 commit 1b40972

File tree

87 files changed

+399
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+399
-563
lines changed

examples/allocations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async fn measure(
126126
#[tokio::main]
127127
async fn main() -> Result<()> {
128128
let args = Args::parse();
129-
println!("{:?}", args);
129+
println!("{args:?}");
130130

131131
println!("Connecting to {} ...", args.node);
132132

examples/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use scylla::client::session_builder::SessionBuilder;
55
async fn main() -> Result<()> {
66
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
77

8-
println!("Connecting to {} with cassandra superuser ...", uri);
8+
println!("Connecting to {uri} with cassandra superuser ...");
99

1010
let session = SessionBuilder::new()
1111
.known_node(uri)

examples/basic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::env;
1111
async fn main() -> Result<()> {
1212
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
1313

14-
println!("Connecting to {} ...", uri);
14+
println!("Connecting to {uri} ...");
1515

1616
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
1717

@@ -57,7 +57,7 @@ async fn main() -> Result<()> {
5757
.await?
5858
.rows_stream::<(i32, i32, String)>()?;
5959
while let Some((a, b, c)) = iter.try_next().await? {
60-
println!("a, b, c: {}, {}, {}", a, b, c);
60+
println!("a, b, c: {a}, {b}, {c}");
6161
}
6262

6363
// Or as custom structs that derive DeserializeRow
@@ -74,7 +74,7 @@ async fn main() -> Result<()> {
7474
.await?
7575
.rows_stream::<RowData>()?;
7676
while let Some(row_data) = iter.try_next().await? {
77-
println!("row_data: {:?}", row_data);
77+
println!("row_data: {row_data:?}");
7878
}
7979

8080
// Or simply as untyped rows
@@ -86,7 +86,7 @@ async fn main() -> Result<()> {
8686
let a = row.columns[0].as_ref().unwrap().as_int().unwrap();
8787
let b = row.columns[1].as_ref().unwrap().as_int().unwrap();
8888
let c = row.columns[2].as_ref().unwrap().as_text().unwrap();
89-
println!("a, b, c: {}, {}, {}", a, b, c);
89+
println!("a, b, c: {a}, {b}, {c}");
9090
}
9191

9292
let metrics = session.get_metrics();

examples/compare-tokens.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::env;
99
async fn main() -> Result<()> {
1010
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
1111

12-
println!("Connecting to {} ...", uri);
12+
println!("Connecting to {uri} ...");
1313

1414
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
1515

@@ -55,7 +55,7 @@ async fn main() -> Result<()> {
5555
.into_rows_result()?
5656
.single_row::<(i64,)>()?;
5757
assert_eq!(t, qt);
58-
println!("token for {}: {}", pk, t);
58+
println!("token for {pk}: {t}");
5959
}
6060

6161
println!("Ok.");

examples/cql-time-types.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::env;
1414
async fn main() -> Result<()> {
1515
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
1616

17-
println!("Connecting to {} ...", uri);
17+
println!("Connecting to {uri} ...");
1818

1919
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
2020

@@ -51,7 +51,7 @@ async fn main() -> Result<()> {
5151
Err(_) => continue, // We might read a date that does not fit in NaiveDate, skip it
5252
};
5353

54-
println!("Parsed a date into chrono::NaiveDate: {:?}", read_date);
54+
println!("Parsed a date into chrono::NaiveDate: {read_date:?}");
5555
}
5656

5757
// Alternatively, you can enable 'time' feature and use `time::Date` to represent date. `time::Date` only allows
@@ -73,7 +73,7 @@ async fn main() -> Result<()> {
7373
Err(_) => continue, // We might read a date that does not fit in time::Date, skip it
7474
};
7575

76-
println!("Parsed a date into time::Date: {:?}", read_date);
76+
println!("Parsed a date into time::Date: {read_date:?}");
7777
}
7878

7979
// Dates outside this range must be represented in the raw form - an u32 describing days since -5877641-06-23
@@ -95,7 +95,7 @@ async fn main() -> Result<()> {
9595
_ => panic!("oh no"),
9696
};
9797

98-
println!("Read a date as raw days: {}", read_days);
98+
println!("Read a date as raw days: {read_days}");
9999
}
100100

101101
// Time
@@ -126,7 +126,7 @@ async fn main() -> Result<()> {
126126
.await?
127127
.rows_stream::<(NaiveTime,)>()?;
128128
while let Some((read_time,)) = iter.try_next().await? {
129-
println!("Parsed a time into chrono::NaiveTime: {:?}", read_time);
129+
println!("Parsed a time into chrono::NaiveTime: {read_time:?}");
130130
}
131131

132132
// time::Time
@@ -141,7 +141,7 @@ async fn main() -> Result<()> {
141141
.await?
142142
.rows_stream::<(time::Time,)>()?;
143143
while let Some((read_time,)) = iter.try_next().await? {
144-
println!("Parsed a time into time::Time: {:?}", read_time);
144+
println!("Parsed a time into time::Time: {read_time:?}");
145145
}
146146

147147
// CqlTime
@@ -156,7 +156,7 @@ async fn main() -> Result<()> {
156156
.await?
157157
.rows_stream::<(CqlTime,)>()?;
158158
while let Some((read_time,)) = iter.try_next().await? {
159-
println!("Read a time as raw nanos: {:?}", read_time);
159+
println!("Read a time as raw nanos: {read_time:?}");
160160
}
161161

162162
// Timestamp
@@ -187,10 +187,7 @@ async fn main() -> Result<()> {
187187
.await?
188188
.rows_stream::<(DateTime<Utc>,)>()?;
189189
while let Some((read_time,)) = iter.try_next().await? {
190-
println!(
191-
"Parsed a timestamp into chrono::DateTime<chrono::Utc>: {:?}",
192-
read_time
193-
);
190+
println!("Parsed a timestamp into chrono::DateTime<chrono::Utc>: {read_time:?}");
194191
}
195192

196193
// time::OffsetDateTime
@@ -208,10 +205,7 @@ async fn main() -> Result<()> {
208205
.await?
209206
.rows_stream::<(time::OffsetDateTime,)>()?;
210207
while let Some((read_time,)) = iter.try_next().await? {
211-
println!(
212-
"Parsed a timestamp into time::OffsetDateTime: {:?}",
213-
read_time
214-
);
208+
println!("Parsed a timestamp into time::OffsetDateTime: {read_time:?}");
215209
}
216210

217211
// CqlTimestamp
@@ -229,7 +223,7 @@ async fn main() -> Result<()> {
229223
.await?
230224
.rows_stream::<(CqlTimestamp,)>()?;
231225
while let Some((read_time,)) = iter.try_next().await? {
232-
println!("Read a timestamp as raw millis: {:?}", read_time);
226+
println!("Read a timestamp as raw millis: {read_time:?}");
233227
}
234228

235229
Ok(())

examples/cqlsh-rs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl Completer for CqlHelper {
164164
if keyword.starts_with(prefix) {
165165
matches.push(Pair {
166166
display: keyword.to_string(),
167-
replacement: format!("{} ", keyword),
167+
replacement: format!("{keyword} "),
168168
})
169169
}
170170
}
@@ -189,7 +189,7 @@ fn print_result(result: QueryResult) -> Result<(), IntoRowsResultError> {
189189
" {:16}",
190190
match column {
191191
None => "null".to_owned(),
192-
Some(value) => format!("{:?}", value),
192+
Some(value) => format!("{value:?}"),
193193
}
194194
);
195195
}
@@ -209,7 +209,7 @@ fn print_result(result: QueryResult) -> Result<(), IntoRowsResultError> {
209209
async fn main() -> Result<()> {
210210
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
211211

212-
println!("Connecting to {} ...", uri);
212+
println!("Connecting to {uri} ...");
213213

214214
let session: Session = SessionBuilder::new()
215215
.known_node(uri)
@@ -233,13 +233,13 @@ async fn main() -> Result<()> {
233233
rl.add_history_entry(line.as_str())?;
234234
let maybe_res = session.query_unpaged(line, &[]).await;
235235
match maybe_res {
236-
Err(err) => println!("Error: {}", err),
236+
Err(err) => println!("Error: {err}"),
237237
Ok(res) => print_result(res)?,
238238
}
239239
}
240240
Err(ReadlineError::Interrupted) => continue,
241241
Err(ReadlineError::Eof) => break,
242-
Err(err) => println!("Error: {}", err),
242+
Err(err) => println!("Error: {err}"),
243243
}
244244
}
245245
Ok(())

examples/custom_deserialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::env;
99
async fn main() -> Result<()> {
1010
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
1111

12-
println!("Connecting to {} ...", uri);
12+
println!("Connecting to {uri} ...");
1313

1414
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
1515

examples/enforce_coordinator.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ async fn query_system_local_and_verify(
3030

3131
// "Actual" host_id and node_ip are the ones returned by the query, i.e. the ones stored in system.local.
3232
let (actual_host_id, actual_node_ip) = result.single_row::<(uuid::Uuid, IpAddr)>().unwrap();
33-
println!(
34-
"queried host_id: {}; queried node_ip: {}",
35-
actual_host_id, actual_node_ip
36-
);
33+
println!("queried host_id: {actual_host_id}; queried node_ip: {actual_node_ip}");
3734

3835
assert_eq!(enforced_node.host_id, actual_host_id);
3936
assert_eq!(enforced_node.address.ip(), actual_node_ip);
@@ -67,7 +64,7 @@ async fn main() -> Result<()> {
6764
// Enforce the node using `Arc<Node>`.
6865
{
6966
let node_identifier = NodeIdentifier::Node(Arc::clone(node));
70-
println!("Enforcing target using {:?}...", node_identifier);
67+
println!("Enforcing target using {node_identifier:?}...");
7168
query_local.set_load_balancing_policy(Some(SingleTargetLoadBalancingPolicy::new(
7269
node_identifier,
7370
None,
@@ -79,7 +76,7 @@ async fn main() -> Result<()> {
7976
// Enforce the node using host_id.
8077
{
8178
let node_identifier = NodeIdentifier::HostId(expected_host_id);
82-
println!("Enforcing target using {:?}...", node_identifier);
79+
println!("Enforcing target using {node_identifier:?}...");
8380
query_local.set_load_balancing_policy(Some(SingleTargetLoadBalancingPolicy::new(
8481
node_identifier,
8582
None,
@@ -92,7 +89,7 @@ async fn main() -> Result<()> {
9289
{
9390
let node_identifier =
9491
NodeIdentifier::NodeAddress(SocketAddr::new(expected_node_ip, node.address.port()));
95-
println!("Enforcing target using {:?}...", node_identifier);
92+
println!("Enforcing target using {node_identifier:?}...");
9693
query_local.set_load_balancing_policy(Some(SingleTargetLoadBalancingPolicy::new(
9794
node_identifier,
9895
None,

examples/execution_profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::time::Duration;
1515
async fn main() -> Result<()> {
1616
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
1717

18-
println!("Connecting to {} ...", uri);
18+
println!("Connecting to {uri} ...");
1919

2020
let profile1 = ExecutionProfile::builder()
2121
.consistency(Consistency::LocalQuorum)

examples/get_by_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async fn main() -> Result<()> {
99
tracing_subscriber::fmt::init();
1010
let uri = env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1".to_string());
1111

12-
println!("Connecting to {} ...", uri);
12+
println!("Connecting to {uri} ...");
1313

1414
let session: Session = SessionBuilder::new().known_node(uri).build().await?;
1515

0 commit comments

Comments
 (0)