Skip to content

Commit ef2558b

Browse files
fix: build of sib (#9992)
* refactor: rename message to util * fix: clippy
1 parent 3c18f02 commit ef2558b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

frameworks/Rust/sib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sib = { git = "https://github.com/PooyaEimandar/sib", default-features = false,
1717
] }
1818
bytes = { version = "1.10.1", default-features = false }
1919
mimalloc = { version = "0.1.47", features = ["secure"] }
20-
num_cpus = { version = "1.16" }
20+
num_cpus = { version = "1.17.0" }
2121
serde = { version = "1.0.219", default-features = false, features = ["derive"] }
2222
serde_json = { version = "1.0.140" }
2323

frameworks/Rust/sib/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bytes::Bytes;
22
use sib::network::http::{
33
h1::{H1Service, H1ServiceFactory},
4-
message::Status,
4+
util::Status,
55
session::Session,
66
};
77
use std::{
@@ -63,7 +63,7 @@ impl H1ServiceFactory for H1Server<HService> {
6363
fn main() {
6464
// Print number of CPU cores
6565
let cpus = num_cpus::get();
66-
println!("CPU cores: {}", cpus);
66+
println!("CPU cores: {cpus}");
6767

6868
// Print total RAM in MB
6969
if let Ok(meminfo) = fs::read_to_string("/proc/meminfo") {
@@ -73,7 +73,7 @@ fn main() {
7373
if parts.len() >= 2 {
7474
if let Ok(kb) = parts[1].parse::<u64>() {
7575
let mb = kb / 1024;
76-
println!("Total RAM: {} MB", mb);
76+
println!("Total RAM: {mb} MB");
7777
}
7878
}
7979
break;
@@ -88,12 +88,12 @@ fn main() {
8888
for _ in 0..cpus {
8989
let handle = std::thread::spawn(move || {
9090
let id = std::thread::current().id();
91-
println!("Listening {} on thread: {:?}", addr, id);
91+
println!("Listening {addr} on thread: {id:?}");
9292
H1Server(HService)
93-
.start(addr, cpus, 0, None)
94-
.expect(&format!("h1 server failed to start for thread {:?}", id))
93+
.start(addr, cpus, 0)
94+
.unwrap_or_else(|_| panic!("h1 server failed to start for thread {id:?}"))
9595
.join()
96-
.expect(&format!("h1 server failed to joining thread {:?}", id));
96+
.unwrap_or_else(|_| panic!("h1 server failed to joining thread {id:?}"));
9797
});
9898
threads.push(handle);
9999
}

0 commit comments

Comments
 (0)