Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
LaoLittle committed Dec 15, 2022
1 parent 90ab623 commit d95be8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/plugin/ffi/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ pub extern "C" fn image_get_id(img: *const ()) -> RustStr {
}

pub extern "C" fn _image_to_flash(img: Managed) {
let img: Image = unsafe {
img.into_value()
};
let img: Image = unsafe { img.into_value() };
img.flash();
}

Expand Down
11 changes: 9 additions & 2 deletions src/service/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ impl PluginManager {
let expected = atri_ffi::plugin::abi_version();

if expected != current {
return Err(PluginError::LoadFail(format!("插件ABI版本为{current}, 期望值为{expected}")).into());
return Err(PluginError::LoadFail(format!(
"插件ABI版本为{current}, 期望值为{expected}"
))
.into());
}

let ptr = (plugin_instance.vtb.new)();
Expand Down Expand Up @@ -355,7 +358,11 @@ impl Plugin {

impl Debug for Plugin {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "Plugin[{:p}({})]", self.handle as *const (), self.lib_name)
write!(
f,
"Plugin[{:p}({})]",
self.handle as *const (), self.lib_name
)
}
}

Expand Down

0 comments on commit d95be8d

Please sign in to comment.