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

@ -2,8 +2,8 @@ use std::{
io::Read,
process::{Command, Stdio},
sync::{
atomic::{AtomicBool, Ordering::Relaxed},
Mutex,
atomic::{AtomicBool, Ordering::Relaxed},
},
};

View File

@ -23,17 +23,18 @@ pub fn with_locale_override<T>(locale_string: &str, func: fn() -> T) -> T {
.expect("Failed to get mutex lock for locale override");
let saved = std::env::var(LOCALE_OVERRIDE_ENV_VAR).ok();
std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_string);
unsafe {
std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_string);
let result = std::panic::catch_unwind(func);
let result = std::panic::catch_unwind(func);
if let Some(locale_str) = saved {
std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_str);
} else {
std::env::remove_var(LOCALE_OVERRIDE_ENV_VAR);
if let Some(locale_str) = saved {
std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_str);
} else {
std::env::remove_var(LOCALE_OVERRIDE_ENV_VAR);
}
result
}
result
};
result.unwrap_or_else(|err| std::panic::resume_unwind(err))
}

View File

@ -233,7 +233,7 @@ macro_rules! nu_with_plugins {
}
use crate::{Outcome, NATIVE_PATH_ENV_VAR};
use crate::{NATIVE_PATH_ENV_VAR, Outcome};
use nu_path::{AbsolutePath, AbsolutePathBuf, Path, PathBuf};
use nu_utils::escape_quote_string;
use std::{

View File

@ -1,5 +1,5 @@
use super::nu_process::*;
use super::EnvironmentVariable;
use super::nu_process::*;
use std::ffi::OsString;
use std::fmt;
use std::fmt::Write;

View File

@ -1,11 +1,11 @@
use super::Director;
use crate::fs::{self, Stub};
use nu_glob::{glob, Uninterruptible};
use nu_glob::{Uninterruptible, glob};
#[cfg(not(target_arch = "wasm32"))]
use nu_path::Path;
use nu_path::{AbsolutePath, AbsolutePathBuf};
use std::str;
use tempfile::{tempdir, TempDir};
use tempfile::{TempDir, tempdir};
#[derive(Default, Clone, Debug)]
pub struct EnvironmentVariable {