From cfcd90fb4c6845259c3870ad75187196a66f8d6b Mon Sep 17 00:00:00 2001 From: Micah Date: Wed, 25 Oct 2023 15:10:30 -0700 Subject: [PATCH] Remove unnecessary borrows --- build.rs | 2 +- src/multimap.rs | 2 +- src/web/api.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index b82f95422..7dbfc98a0 100644 --- a/build.rs +++ b/build.rs @@ -46,7 +46,7 @@ fn main() -> Result<(), anyhow::Error> { let our_version = Version::parse(env::var_os("CARGO_PKG_VERSION").unwrap().to_str().unwrap())?; let plugin_version = - Version::parse(fs::read_to_string(&plugin_root.join("Version.txt"))?.trim())?; + Version::parse(fs::read_to_string(plugin_root.join("Version.txt"))?.trim())?; assert!( our_version.major == plugin_version.major, diff --git a/src/multimap.rs b/src/multimap.rs index 02191e6a2..3a243af1a 100644 --- a/src/multimap.rs +++ b/src/multimap.rs @@ -24,7 +24,7 @@ impl MultiMap { K: Borrow, Q: Hash + Eq, { - self.inner.get(k.borrow()).map(Vec::as_slice).unwrap_or(&[]) + self.inner.get(k).map(Vec::as_slice).unwrap_or(&[]) } pub fn insert(&mut self, k: K, v: V) { diff --git a/src/web/api.rs b/src/web/api.rs index 338862f7c..4156af35d 100644 --- a/src/web/api.rs +++ b/src/web/api.rs @@ -159,7 +159,7 @@ impl ApiService { }) .unwrap(); - json_ok(&WriteResponse { session_id }) + json_ok(WriteResponse { session_id }) } async fn handle_api_read(&self, request: Request) -> Response { @@ -271,7 +271,7 @@ impl ApiService { }, }; - json_ok(&OpenResponse { + json_ok(OpenResponse { session_id: self.serve_session.session_id(), }) }