mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 07:40:19 +02:00
Rust 1.85, edition=2024 (#15741)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
authors = ["The Nushell Project Developers"]
|
||||
description = "Support for writing Nushell tests"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-test-support"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-test-support"
|
||||
version = "0.104.1"
|
||||
@@ -21,4 +21,4 @@ nu-utils = { path = "../nu-utils", version = "0.104.1" }
|
||||
|
||||
num-format = { workspace = true }
|
||||
which = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
|
@@ -2,8 +2,8 @@ use std::{
|
||||
io::Read,
|
||||
process::{Command, Stdio},
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering::Relaxed},
|
||||
Mutex,
|
||||
atomic::{AtomicBool, Ordering::Relaxed},
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -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))
|
||||
}
|
||||
|
@@ -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::{
|
||||
|
@@ -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;
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user