Skip to content

Commit e87fe89

Browse files
Fredrik Simonssonepilys
authored andcommitted
Rework error check.
Signed-off-by: Fredrik Simonsson <[email protected]>
1 parent 750c458 commit e87fe89

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vhost-device-scmi/src/main.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ impl TryFrom<args::ScmiArgs> for VuScmiConfig {
9393
fn start_backend(config: VuScmiConfig) -> Result<()> {
9494
loop {
9595
debug!("Starting backend");
96-
let backend_instance = VuScmiBackend::new(&config);
97-
if let Err(error) = backend_instance {
98-
return Err(error.to_string());
99-
}
100-
101-
let backend = Arc::new(RwLock::new(backend_instance.map_err(|e| format!("{e}"))?));
96+
let backend = Arc::new(RwLock::new(
97+
VuScmiBackend::new(&config).map_err(|e| e.to_string())?,
98+
));
10299
let mut daemon = VhostUserDaemon::new(
103100
"vhost-device-scmi".to_owned(),
104101
backend.clone(),

0 commit comments

Comments
 (0)