mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:55:42 +02:00
Replace &Span
with Span
since Span
is Copy
(#9770)
# Description `Span` is `Copy`, so we probably should not be passing references of `Span` around. This PR replaces all instances of `&Span` with `Span`, copying spans where necessary. # User-Facing Changes This alters some public functions to take `Span` instead of `&Span` as input. Namely, `EngineState::get_span_contents`, `nu_protocol::extract_value`, a bunch of the math commands, and `Gstat::gstat`.
This commit is contained in:
@ -46,9 +46,9 @@ impl Command for SubCommand {
|
||||
}
|
||||
|
||||
/// Calculate product of given values
|
||||
pub fn product(values: &[Value], span: Span, head: &Span) -> Result<Value, ShellError> {
|
||||
pub fn product(values: &[Value], span: Span, head: Span) -> Result<Value, ShellError> {
|
||||
let product_func = reducer_for(Reduce::Product);
|
||||
product_func(Value::nothing(*head), values.to_vec(), span, *head)
|
||||
product_func(Value::nothing(head), values.to_vec(), span, head)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Reference in New Issue
Block a user