Skip to content

Commit

Permalink
Merge pull request #1395 from hannobraun/cleanup
Browse files Browse the repository at this point in the history
Make some small cleanups
  • Loading branch information
hannobraun authored Nov 25, 2022
2 parents 1ba7990 + 91c88d1 commit 805d1a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/fj-host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ impl Host {
pub fn from_model(model: Model) -> Result<Self, Error> {
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,
})
}

Expand Down
8 changes: 4 additions & 4 deletions crates/fj-host/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down
6 changes: 4 additions & 2 deletions crates/fj-window/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
));
}
}
}
Expand Down

0 comments on commit 805d1a0

Please sign in to comment.