Skip to content

Commit

Permalink
axum: remove unnecessary Arc::clone
Browse files Browse the repository at this point in the history
  • Loading branch information
mladedav committed Mar 22, 2024
1 parent 2ec68d6 commit caf9073
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions axum/src/routing/path_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ where
}

fn set_node(&mut self, path: &str, id: RouteId) -> Result<(), String> {
let mut node =
Arc::try_unwrap(Arc::clone(&self.node)).unwrap_or_else(|node| (*node).clone());
let mut node = (*self.node).clone();
if let Err(err) = node.insert(path, id) {
return Err(format!("Invalid route {path:?}: {err}"));
}
Expand Down

0 comments on commit caf9073

Please sign in to comment.