Skip to content

Commit e17e9b8

Browse files
ci: rust 1.88
1 parent effb0c3 commit e17e9b8

File tree

135 files changed

+329
-412
lines changed

Some content is hidden

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

135 files changed

+329
-412
lines changed

crates/apollo_batcher/src/batcher_test.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -323,30 +323,22 @@ fn assert_proposal_metrics(
323323
assert_eq!(
324324
started,
325325
Some(expected_started),
326-
"unexpected value proposal_started, expected {} got {:?}",
327-
expected_started,
328-
started,
326+
"unexpected value proposal_started, expected {expected_started} got {started:?}",
329327
);
330328
assert_eq!(
331329
succeeded,
332330
Some(expected_succeeded),
333-
"unexpected value proposal_succeeded, expected {} got {:?}",
334-
expected_succeeded,
335-
succeeded,
331+
"unexpected value proposal_succeeded, expected {expected_succeeded} got {succeeded:?}",
336332
);
337333
assert_eq!(
338334
failed,
339335
Some(expected_failed),
340-
"unexpected value proposal_failed, expected {} got {:?}",
341-
expected_failed,
342-
failed,
336+
"unexpected value proposal_failed, expected {expected_failed} got {failed:?}",
343337
);
344338
assert_eq!(
345339
aborted,
346340
Some(expected_aborted),
347-
"unexpected value proposal_aborted, expected {} got {:?}",
348-
expected_aborted,
349-
aborted,
341+
"unexpected value proposal_aborted, expected {expected_aborted} got {aborted:?}",
350342
);
351343
}
352344

crates/apollo_central_sync/src/sources/central/state_update_stream.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ async fn download_class_if_necessary<TStarknetClient: StarknetReader>(
358358

359359
// Check declared classes.
360360
if let Ok(Some(class)) = state_reader.get_class_definition_at(state_number, &class_hash) {
361-
trace!("Class {:?} retrieved from storage.", class_hash);
361+
trace!("Class {class_hash:?} retrieved from storage.");
362362
{
363363
let mut cache = cache.lock().expect("Failed to lock class cache.");
364364
cache.put(class_hash, ApiContractClass::ContractClass(class.clone()));
@@ -370,7 +370,7 @@ async fn download_class_if_necessary<TStarknetClient: StarknetReader>(
370370
if let Ok(Some(class)) =
371371
state_reader.get_deprecated_class_definition_at(state_number, &class_hash)
372372
{
373-
trace!("Deprecated class {:?} retrieved from storage.", class_hash);
373+
trace!("Deprecated class {class_hash:?} retrieved from storage.");
374374
{
375375
let mut cache = cache.lock().expect("Failed to lock class cache.");
376376
cache.put(class_hash, ApiContractClass::DeprecatedContractClass(class.clone()));
@@ -379,7 +379,7 @@ async fn download_class_if_necessary<TStarknetClient: StarknetReader>(
379379
}
380380

381381
// Class not found in storage - download.
382-
trace!("Downloading class {:?}.", class_hash);
382+
trace!("Downloading class {class_hash:?}.");
383383
let client_class = apollo_starknet_client.class_by_hash(class_hash).await.map_err(Arc::new)?;
384384
match client_class {
385385
None => Ok(None),

crates/apollo_central_sync/src/sources/central_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async fn stream_block_headers_some_are_missing() {
124124
(false, true, "signature missing"),
125125
];
126126
for (block_missing, signature_missing, test_case_description) in test_cases {
127-
println!("Test case: {}", test_case_description);
127+
println!("Test case: {test_case_description}");
128128
const START_BLOCK_NUMBER: u64 = 5;
129129
const END_BLOCK_NUMBER: u64 = 13;
130130
const MISSING_BLOCK_NUMBER: u64 = 9;

crates/apollo_class_manager/src/metrics.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ pub(crate) fn increment_n_classes(cls_type: CairoClassType) {
5656

5757
pub(crate) fn record_class_size<T>(class_type: ClassObjectType, class: &SerializedClass<T>) {
5858
let class_size = class.size().unwrap_or_else(|_| {
59-
panic!("Illegally formatted {} class, should not have gotten into the system.", class_type)
59+
panic!("Illegally formatted {class_type} class, should not have gotten into the system.")
6060
});
6161
let class_size = u32::try_from(class_size).unwrap_or_else(|_| {
6262
panic!(
63-
"{} class size {} is bigger than what is allowed,
64-
should not have gotten into the system.",
65-
class_type, class_size
63+
"{class_type} class size {class_size} is bigger than what is allowed,
64+
should not have gotten into the system."
6665
)
6766
});
6867

crates/apollo_compilation_utils/src/build_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn install_compiler_binary(
4747
.unwrap_or_else(|_| panic!("Failed to install {binary_name}"));
4848

4949
if !install_command_status.success() {
50-
panic!("Failed to install {}", binary_name);
50+
panic!("Failed to install {binary_name}");
5151
}
5252

5353
// Move the '{binary_name}' executable to a shared location.
@@ -59,7 +59,7 @@ pub fn install_compiler_binary(
5959
.expect("Failed to perform mv command.");
6060

6161
if !move_command_status.success() {
62-
panic!("Failed to move the {} binary to the shared folder.", binary_name);
62+
panic!("Failed to move the {binary_name} binary to the shared folder.");
6363
}
6464

6565
std::fs::remove_dir_all(temp_cargo_path).expect("Failed to remove the cargo directory.");

crates/apollo_compilation_utils/src/compiler_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn compile_with_args(
4646
"Process exited with non-zero status but no signal (likely a handled error, e.g., \
4747
memory allocation failure)."
4848
}
49-
Some(sig) => &format!("Process terminated by unexpected signal: {}", sig),
49+
Some(sig) => &format!("Process terminated by unexpected signal: {sig}"),
5050
};
5151

5252
let stderr_output = String::from_utf8(compile_output.stderr)

crates/apollo_compilation_utils/src/resource_limits/resource_limits_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn test_cpu_time_limit() {
1919
let status = command.spawn().expect("Failed to start CPU consuming process").wait().unwrap();
2020
assert!(start.elapsed().as_secs() <= cpu_limit);
2121
let signal = status.signal();
22-
assert_eq!(signal, Some(9), "Process should terminate with SIGKILL (9) got {:?}", signal);
22+
assert_eq!(signal, Some(9), "Process should terminate with SIGKILL (9) got {signal:?}");
2323
}
2424

2525
#[rstest]
@@ -34,7 +34,7 @@ fn test_memory_size_limit() {
3434
let output = command.output().expect("Failed to start memory consuming process");
3535

3636
let signal = output.status.signal();
37-
assert!(signal.is_none(), "Exceeding memory usage should not cause a signal, got {:?}", signal);
37+
assert!(signal.is_none(), "Exceeding memory usage should not cause a signal, got {signal:?}");
3838

3939
let stderr = String::from_utf8_lossy(&output.stderr);
4040

@@ -66,7 +66,7 @@ fn test_file_size_limit() {
6666
let status = command.spawn().expect("Failed to start disk consuming process").wait().unwrap();
6767
assert_eq!(std::fs::metadata(temp_file_path).unwrap().len(), file_limit);
6868
let signal = status.signal();
69-
assert!(signal == Some(25), "Process should terminate with SIGXFSZ (25), got {:?}", signal);
69+
assert!(signal == Some(25), "Process should terminate with SIGXFSZ (25), got {signal:?}");
7070
}
7171

7272
#[rstest]

crates/apollo_compile_to_casm/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn install_starknet_sierra_compile() {
2626
// available only after the build is completed. Most importantly, it is available during runtime.
2727
fn set_run_time_out_dir_env_var() {
2828
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR is not set");
29-
println!("cargo:rustc-env=RUNTIME_ACCESSIBLE_OUT_DIR={}", out_dir);
29+
println!("cargo:rustc-env=RUNTIME_ACCESSIBLE_OUT_DIR={out_dir}");
3030
}
3131

3232
// Returns the OUT_DIR. This function is only operable at build time.

crates/apollo_compile_to_native/build_with_cairo_native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn install_starknet_native_compile() {
2525
// available only after the build is completed. Most importantly, it is available during runtime.
2626
fn set_run_time_out_dir_env_var() {
2727
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR is not set");
28-
println!("cargo:rustc-env=RUNTIME_ACCESSIBLE_OUT_DIR={}", out_dir);
28+
println!("cargo:rustc-env=RUNTIME_ACCESSIBLE_OUT_DIR={out_dir}");
2929
}
3030

3131
// Returns the OUT_DIR. This function is only operable at build time.

crates/apollo_config/src/converters.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub fn serialize_optional_vec_u8(optional_vector: &Option<Vec<u8>>) -> String {
9595
Some(vector) => {
9696
format!(
9797
"0x{}",
98-
vector.iter().map(|num| format!("{:02x}", num)).collect::<Vec<String>>().join("")
98+
vector.iter().map(|num| format!("{num:02x}")).collect::<Vec<String>>().join("")
9999
)
100100
}
101101
}
@@ -125,8 +125,7 @@ where
125125
let byte_str = &hex_str[i..i + 2];
126126
let byte = u8::from_str_radix(byte_str, 16).map_err(|e| {
127127
D::Error::custom(format!(
128-
"Couldn't deserialize vector. Failed to parse byte: {} {}",
129-
byte_str, e
128+
"Couldn't deserialize vector. Failed to parse byte: {byte_str} {e}"
130129
))
131130
})?;
132131
vector.push(byte);

0 commit comments

Comments
 (0)