diff --git a/crates/nit/src/main.rs b/crates/nit/src/main.rs index 389710b..c282fef 100644 --- a/crates/nit/src/main.rs +++ b/crates/nit/src/main.rs @@ -9,7 +9,7 @@ use system::dmesg; fn main() { if let Err(e) = init() { dmesg(format!("Error: {e}")); - let mut opt = Some(&e as &dyn std::error::Error); + let mut opt = std::error::Error::source(&e); while let Some(current_source) = opt { dmesg(format!("Caused by: {current_source}")); opt = current_source.source(); @@ -28,7 +28,7 @@ fn init() -> Result<()> { if let Err(errors) = system::mount_default_targets() { for error in errors { dmesg(format!("Error while mounting: {error}")); - let mut opt = Some(&error as &dyn std::error::Error); + let mut opt = std::error::Error::source(&error); while let Some(current_source) = opt { dmesg(format!("Caused by: {current_source}")); opt = current_source.source(); @@ -65,7 +65,7 @@ fn init() -> Result<()> { */ } config::Mode::Exec => { - dmesg("pivoting to {command}"); + dmesg(format!("pivoting to {command}")); system::syscall::execv(command, &[])?; } }