Skip to content

Commit 76be38c

Browse files
authored
Merge pull request #690 from hermit-os/nightly-2025-05-01
chore: upgrade toolchain channel to nightly-2025-05-01
2 parents a9bf5bb + 1cef95b commit 76be38c

File tree

15 files changed

+26
-26
lines changed

15 files changed

+26
-26
lines changed

benches/alloc/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn print_bench_results(bench_name: &str, res: &BenchRunResults) {
174174
}
175175

176176
fn print_measurement_set(measurements: &[u64], set_name: &str) {
177-
print!("{:>20} | ", set_name);
177+
print!("{set_name:>20} | ");
178178
for i in 0..=8 {
179179
print!(
180180
"{:>8}",

examples/demo/src/matmul.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,5 +400,5 @@ pub fn matmul() {
400400
let par = timed_matmul(SIZE, matmulz, "par z-order");
401401
timed_matmul(SIZE, matmul_strassen, "par strassen");
402402
let speedup = seq as f64 / par as f64;
403-
eprintln!("speedup: {:.2}x", speedup);
403+
eprintln!("speedup: {speedup:.2}x");
404404
}

examples/dns/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main() {
2424
}
2525

2626
let addr = Ipv4Addr::from(u32::from_be(inaddr.s_addr));
27-
println!("IPv4 address {}", addr);
27+
println!("IPv4 address {addr}");
2828

2929
let mut inaddr: in6_addr = Default::default();
3030
let result = unsafe {
@@ -40,7 +40,7 @@ fn main() {
4040
}
4141

4242
let addr = Ipv6Addr::from(u128::from_be_bytes(inaddr.s6_addr));
43-
println!("IPv6 address {}", addr);
43+
println!("IPv6 address {addr}");
4444

4545
// retake pointer to free memory
4646
let _ = unsafe { CString::from_raw(ptr) };

examples/miotcp/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn main() -> io::Result<()> {
7171
}
7272
};
7373

74-
println!("Accepted connection from: {}", address);
74+
println!("Accepted connection from: {address}");
7575

7676
let token = next(&mut unique_token);
7777
poll.registry().register(
@@ -182,7 +182,7 @@ fn handle_connection_event(
182182
return Ok(EventStatus::Exit);
183183
}
184184
} else {
185-
println!("Received (none UTF-8) data: {:?}", received_data);
185+
println!("Received (none UTF-8) data: {received_data:?}");
186186
}
187187
}
188188

examples/mioudp/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn main() -> io::Result<()> {
8686
// This should never happen as we only registered our
8787
// `UdpSocket` using the `UDP_SOCKET` token, but if it ever
8888
// does we'll log it.
89-
warn!("Got event for unexpected token: {:?}", event);
89+
warn!("Got event for unexpected token: {event:?}");
9090
}
9191
}
9292
}

examples/mutex/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl SpinBarrier {
2828
}
2929

3030
fn mutex_stress_test(no_threads: usize) {
31-
println!("Stress mutex with {} threads!", no_threads);
31+
println!("Stress mutex with {no_threads} threads!");
3232

3333
let counter = Arc::new(Mutex::new(0));
3434

examples/polling/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn main() -> io::Result<()> {
5858
let received = stream.read(&mut buf)?;
5959
poller.modify(stream, Event::readable(ev.key))?;
6060
let msg = std::str::from_utf8(&buf[..received]).unwrap().trim_end();
61-
println!("{}", msg);
61+
println!("{msg}");
6262
if msg == "exit" {
6363
break 'outer;
6464
}

examples/testudp/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ fn main() {
2222
// print msg without suffix `\n`
2323
match msg.strip_suffix('\n') {
2424
Some(striped_msg) => {
25-
println!("received \"{}\" from {}", striped_msg, addr);
25+
println!("received \"{striped_msg}\" from {addr}");
2626
}
2727
_ => {
28-
println!("received \"{}\" from {}", msg, addr);
28+
println!("received \"{msg}\" from {addr}");
2929
}
3030
}
3131

examples/thread_test/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ fn main() {
5050
let num_threads = std::thread::available_parallelism()
5151
.map(|n| n.get() * 2)
5252
.unwrap_or(4);
53-
println!("Spawning {} threads (2 x number of cores)", num_threads);
53+
println!("Spawning {num_threads} threads (2 x number of cores)");
5454

5555
let mut handles = vec![];
5656

5757
// Spawn threads to test TLS isolation and modification.
5858
for i in 0..num_threads {
5959
handles.push(thread::spawn(move || {
60-
println!("Thread {} started", i);
60+
println!("Thread {i} started");
6161

6262
// Check alignment.
6363
TLS_ALIGNED.with(|x| assert!(x.as_ptr().is_aligned()));
@@ -134,7 +134,7 @@ fn main() {
134134
assert_eq!(TLS_ALIGNED.get().0, 0x42 + i as u8 + 10);
135135
assert_eq!(TLS_U64_2.get(), (0xdeadbeef + i as u64) ^ 0xf0f0f0f0);
136136

137-
println!("Thread {} finished", i);
137+
println!("Thread {i} finished");
138138
}));
139139
}
140140

@@ -172,7 +172,7 @@ fn main() {
172172
}
173173
TLS_MAP.with(|map| {
174174
let value = map.borrow().get(&1).cloned().unwrap_or(0);
175-
println!("TLS_MAP value for key 1: {}", value);
175+
println!("TLS_MAP value for key 1: {value}");
176176
assert_eq!(value, 2);
177177
});
178178
}
@@ -204,7 +204,7 @@ fn main() {
204204
handle.join().unwrap();
205205
thread::sleep(Duration::from_millis(50));
206206
let flag_val = TLS_DESTRUCTOR_RAN.load(Ordering::SeqCst);
207-
println!("TLS destructor flag: {}", flag_val);
207+
println!("TLS destructor flag: {flag_val}");
208208
assert!(flag_val, "TLS destructor did not run");
209209
}
210210

examples/tls/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
4040
// Load private key.
4141
let key = load_private_key()?;
4242

43-
println!("Starting to serve on https://{}", addr);
43+
println!("Starting to serve on https://{addr}");
4444

4545
// Create a TCP listener via tokio.
4646
let incoming = TcpListener::bind(addr).await?;

0 commit comments

Comments
 (0)