mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Make Call::get_flag_expr
return Expression
by ref (#11388)
# Description A small refactor that eliminates some `Expression` cloning. # User-Facing Changes Breaking change for `nu_protocol`.
This commit is contained in:
@ -164,10 +164,10 @@ impl Call {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn get_flag_expr(&self, flag_name: &str) -> Option<Expression> {
|
||||
pub fn get_flag_expr(&self, flag_name: &str) -> Option<&Expression> {
|
||||
for name in self.named_iter() {
|
||||
if flag_name == name.0.item {
|
||||
return name.2.clone();
|
||||
return name.2.as_ref();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user