mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 15:58:37 +02:00
Deref &String
arguments to &str
where appropriate (#10321)
# Description This generally makes for nicer APIs, as you are not forced to use an existing allocation covering the full `String`. Some exceptions remain where the underlying type requirements favor it. # User-Facing Changes None
This commit is contained in:
committed by
GitHub
parent
e90b099622
commit
6e9b6f22c9
@ -376,8 +376,8 @@ impl Stack {
|
||||
engine_state.env_vars.contains_key(name)
|
||||
}
|
||||
|
||||
pub fn is_overlay_active(&self, name: &String) -> bool {
|
||||
self.active_overlays.contains(name)
|
||||
pub fn is_overlay_active(&self, name: &str) -> bool {
|
||||
self.active_overlays.iter().any(|n| n == name)
|
||||
}
|
||||
|
||||
pub fn add_overlay(&mut self, name: String) {
|
||||
@ -385,7 +385,7 @@ impl Stack {
|
||||
self.active_overlays.push(name);
|
||||
}
|
||||
|
||||
pub fn remove_overlay(&mut self, name: &String) {
|
||||
pub fn remove_overlay(&mut self, name: &str) {
|
||||
self.active_overlays.retain(|o| o != name);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user