richox commented on code in PR #1649:
URL: https://github.com/apache/auron/pull/1649#discussion_r2575793364
##########
native-engine/auron/src/http/mod.rs:
##########
@@ -50,7 +50,7 @@ impl DefaultHTTPServer {
.worker_threads(1)
.enable_io()
.build()
- .unwrap(),
+ .expect("runtime"),
Review Comment:
use a more meaningful words in `expect()` to describe why we can safely
extract the value, or why we should fast-fail in unexpected case.
for example: `.expect("fast fail for error initializing runtime")`
##########
native-engine/auron/src/alloc.rs:
##########
@@ -57,7 +57,7 @@ impl<T: GlobalAlloc> DebugAlloc<T> {
}
fn update(&self) {
- let _lock = self.mutex.lock().unwrap();
+ let _lock = self.mutex.lock().expect("lock");
Review Comment:
we replace this with parking_lot::Mutex, it has a unwrap-free lock API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]