From 7681c3415ebc974e5d2617020acad3e0da81cde9 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 3 Nov 2022 10:41:16 +0100 Subject: [PATCH] Remove redundant allocations --- crates/fj-host/src/model.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/fj-host/src/model.rs b/crates/fj-host/src/model.rs index c4f6acdfb..61285beb9 100644 --- a/crates/fj-host/src/model.rs +++ b/crates/fj-host/src/model.rs @@ -108,13 +108,13 @@ impl Model { let version_pkg: libloading::Symbol RawVersion> = lib.get(b"version_pkg").map_err(Error::LoadingVersion)?; - let version_pkg = version_pkg(); - if fj::version::VERSION_PKG != version_pkg.to_string() { + let version_pkg = version_pkg().to_string(); + if fj::version::VERSION_PKG != version_pkg { let host = String::from_utf8_lossy( fj::version::VERSION_PKG.as_bytes(), ) .into_owned(); - let model = version_pkg.to_string(); + let model = version_pkg; return Err(Error::VersionMismatch { host, model }); } @@ -122,13 +122,13 @@ impl Model { let version_full: libloading::Symbol RawVersion> = lib.get(b"version_full").map_err(Error::LoadingVersion)?; - let version_full = version_full(); - if fj::version::VERSION_FULL != version_full.to_string() { + let version_full = version_full().to_string(); + if fj::version::VERSION_FULL != version_full { let host = String::from_utf8_lossy( fj::version::VERSION_FULL.as_bytes(), ) .into_owned(); - let model = version_full.to_string(); + let model = version_full; warn!("{}", Error::VersionMismatch { host, model }); }