Repository: nushell/nushell
File: crates/nu-command/src/network/url/join.rs (Rust)

Code before:
        }

        if key == "params" {
            let mut qs = match value {
                Value::Record { ref val, .. } => record_to_query_string(val, value_span, head)?,
                Value::List { ref vals, .. } => table_to_query_string(vals, value_span, head)?,
                Value::Error { error, .. } => return Err(*error),
                other => {
                    return Err(ShellError::IncompatibleParametersSingle {
                        msg: String::from("Key params has to be a record or a table"),
                        span: other.span(),
                    })
                }
            };

            qs = if !qs.trim().is_empty() {
                format!("?{qs}")
            } else {
                qs
            };

            if let Some(q) = self.query {
                if q != qs {
                    // if query is present it means that also query_span is set.
                    return Err(ShellError::IncompatibleParameters {
                        left_message: format!("Mismatch, qs from params is: {qs}"),
                        left_span: value_span,
                        right_message: format!("instead query is: {q}"),
                        right_span: self.query_span.unwrap_or(Span::unknown()),
                    });
                }
            }

            return Ok(Self {
                query: Some(qs),
                params_span: Some(value_span),
                ..self
            });
        }

        // apart from port and params all other keys are strings.
        let s = value.coerce_into_string()?; // If value fails String conversion, just output this ShellError
        if !Self::check_empty_string_ok(&key, &s, value_span)? {
            return Ok(self);
        }
        match key.as_str() {
            "host" => Ok(Self {
                host: Some(s),
                ..self
            }),
            "scheme" => Ok(Self {

Review comment (suggestion):
```suggestion
                        left_message: format!("Mismatch, query string from params is: {qs}"),
```

Code after:
        }

        if key == "params" {
            let mut qs = match value {
                Value::Record { ref val, .. } => record_to_query_string(val, value_span, head)?,
                Value::List { ref vals, .. } => table_to_query_string(vals, value_span, head)?,
                Value::Error { error, .. } => return Err(*error),
                other => {
                    return Err(ShellError::IncompatibleParametersSingle {
                        msg: String::from("Key params has to be a record or a table"),
                        span: other.span(),
                    })
                }
            };

            qs = if !qs.trim().is_empty() {
                format!("?{qs}")
            } else {
                qs
            };

            if let Some(q) = self.query {
                if q != qs {
                    // if query is present it means that also query_span is set.
                    return Err(ShellError::IncompatibleParameters {
                        left_message: format!("Mismatch, query string from params is: {qs}"),
                        left_span: value_span,
                        right_message: format!("instead query is: {q}"),
                        right_span: self.query_span.unwrap_or(Span::unknown()),
                    });
                }
            }

            return Ok(Self {
                query: Some(qs),
                params_span: Some(value_span),
                ..self
            });
        }

        // apart from port and params all other keys are strings.
        let s = value.coerce_into_string()?; // If value fails String conversion, just output this ShellError
        if !Self::check_empty_string_ok(&key, &s, value_span)? {
            return Ok(self);
        }
        match key.as_str() {
            "host" => Ok(Self {
                host: Some(s),
                ..self
            }),
            "scheme" => Ok(Self {