Rust 1.85, edition=2024 (#15741)

This commit is contained in:
Jack Wright
2025-05-13 07:49:30 -07:00
committed by GitHub
parent 1a0986903f
commit c2ac8f730e
793 changed files with 4276 additions and 3687 deletions

View File

@ -1,6 +1,7 @@
use crate::{
NuStyle,
nu_style::{color_from_hex, lookup_style},
parse_nustyle, NuStyle,
parse_nustyle,
};
use nu_ansi_term::Style;
use nu_protocol::{Record, Value};
@ -67,11 +68,7 @@ fn get_style_from_value(record: &Record) -> Option<NuStyle> {
}
}
if was_set {
Some(style)
} else {
None
}
if was_set { Some(style) } else { None }
}
fn color_string_to_nustyle(color_string: &str) -> Style {
@ -92,7 +89,7 @@ fn color_string_to_nustyle(color_string: &str) -> Style {
mod tests {
use super::*;
use nu_ansi_term::{Color, Style};
use nu_protocol::{record, Span, Value};
use nu_protocol::{Span, Value, record};
#[test]
fn test_color_string_to_nustyle_empty_string() {

View File

@ -47,11 +47,7 @@ fn style_get_attr(s: Style) -> Option<String> {
attrs.push('u');
};
if attrs.is_empty() {
None
} else {
Some(attrs)
}
if attrs.is_empty() { None } else { Some(attrs) }
}
fn color_to_string(color: Color) -> Option<String> {

View File

@ -1,9 +1,10 @@
use crate::{color_record_to_nustyle, lookup_ansi_color_style, text_style::Alignment, TextStyle};
use crate::{TextStyle, color_record_to_nustyle, lookup_ansi_color_style, text_style::Alignment};
use nu_ansi_term::{Color, Style};
use nu_engine::ClosureEvalOnce;
use nu_protocol::{
Span, Value,
engine::{Closure, EngineState, Stack},
report_shell_error, Span, Value,
report_shell_error,
};
use std::{
collections::HashMap,
@ -240,9 +241,11 @@ fn test_computable_style_closure_errors() {
];
let actual_repl = nu!(nu_repl_code(&inp));
// Check that the error was printed
assert!(actual_repl
.err
.contains("nu::shell::operator_incompatible_types"));
assert!(
actual_repl
.err
.contains("nu::shell::operator_incompatible_types")
);
// Check that the value was printed
assert!(actual_repl.out.contains("bell"));
}