From a4ec2d0fcb1b34a9769cfdbb23251f7940af0358 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 21 Nov 2022 14:17:57 +0100 Subject: [PATCH 1/3] Fix variable name --- crates/fj-host/src/model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/fj-host/src/model.rs b/crates/fj-host/src/model.rs index 7755da9db..43213dd0f 100644 --- a/crates/fj-host/src/model.rs +++ b/crates/fj-host/src/model.rs @@ -109,16 +109,16 @@ impl Model { let version_pkg_model: libloading::Symbol<*const Version> = lib.get(b"VERSION_PKG").map_err(Error::LoadingVersion)?; - let version_pkg_mode = (**version_pkg_model).to_string(); + let version_pkg_model = (**version_pkg_model).to_string(); debug!( "Comparing package versions (host: {}, model: {})", - version_pkg_host, version_pkg_mode + version_pkg_host, version_pkg_model ); - if version_pkg_host != version_pkg_mode { + if version_pkg_host != version_pkg_model { let host = String::from_utf8_lossy(version_pkg_host.as_bytes()) .into_owned(); - let model = version_pkg_mode; + let model = version_pkg_model; return Err(Error::VersionMismatch { host, model }); } From d6ae573f45b5d613aabbc5aa7a118e98224580eb Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 21 Nov 2022 15:27:06 +0100 Subject: [PATCH 2/3] Prevent accidentally ignoring local variable --- crates/fj-host/src/host.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-host/src/host.rs b/crates/fj-host/src/host.rs index 8a556e10b..9e1c20219 100644 --- a/crates/fj-host/src/host.rs +++ b/crates/fj-host/src/host.rs @@ -16,11 +16,11 @@ impl Host { pub fn from_model(model: Model) -> Result { let watch_path = model.watch_path(); let evaluator = Evaluator::from_model(model); - let _watcher = Watcher::watch_model(&watch_path, &evaluator)?; + let watcher = Watcher::watch_model(&watch_path, &evaluator)?; Ok(Self { evaluator, - _watcher, + _watcher: watcher, }) } From 91c88d177057ab1f7b2c6530df1bfad8ef520dde Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 21 Nov 2022 16:05:47 +0100 Subject: [PATCH 3/3] Improve error message --- crates/fj-window/src/run.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/fj-window/src/run.rs b/crates/fj-window/src/run.rs index 933f3b346..cf1dce713 100644 --- a/crates/fj-window/src/run.rs +++ b/crates/fj-window/src/run.rs @@ -209,8 +209,10 @@ pub fn run( Ok(new_host) => { host = Some(new_host); } - Err(_) => { - status.update_status("Error creating host."); + Err(err) => { + status.update_status(&format!( + "Error creating host: {err}" + )); } } }