Skip to content

Commit

Permalink
Remove unnecessary borrows (rojo-rbx#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekkonot committed Oct 25, 2023
1 parent 9f13bca commit cd14ea7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/multimap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<K: Hash + Eq, V: Eq> MultiMap<K, V> {
K: Borrow<Q>,
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) {
Expand Down
4 changes: 2 additions & 2 deletions src/web/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Body>) -> Response<Body> {
Expand Down Expand Up @@ -271,7 +271,7 @@ impl ApiService {
},
};

json_ok(&OpenResponse {
json_ok(OpenResponse {
session_id: self.serve_session.session_id(),
})
}
Expand Down

0 comments on commit cd14ea7

Please sign in to comment.