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:
Ian Manske
2023-07-31 19:47:46 +00:00
committed by GitHub
parent 94bec72079
commit 583ef8674e
35 changed files with 356 additions and 365 deletions

View File

@ -548,8 +548,7 @@ impl<'e, 's> ScopeData<'e, 's> {
Value::String { val: key, span },
Value::String {
val: String::from_utf8_lossy(
self.engine_state
.get_span_contents(&alias.wrapped_call.span),
self.engine_state.get_span_contents(alias.wrapped_call.span),
)
.to_string(),
span,