mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #7423 from sylvestre/rust-2024
bump to Rust edition 2024 & min = 1.85
This commit is contained in:
@@ -11,7 +11,7 @@ env:
|
||||
PROJECT_NAME: coreutils
|
||||
PROJECT_DESC: "Core universal (cross-platform) utilities"
|
||||
PROJECT_AUTH: "uutils"
|
||||
RUST_MIN_SRV: "1.82.0"
|
||||
RUST_MIN_SRV: "1.85.0"
|
||||
# * style job configuration
|
||||
STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis
|
||||
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ repository = "https://github.com/uutils/coreutils"
|
||||
readme = "README.md"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
rust-version = "1.82.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.85.0"
|
||||
edition = "2024"
|
||||
|
||||
build = "build.rs"
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://deps.rs/repo/github/uutils/coreutils)
|
||||
|
||||
[](https://codecov.io/gh/uutils/coreutils)
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@ the [coreutils docs](https://github.com/uutils/uutils.github.io) repository.
|
||||
### Rust Version
|
||||
|
||||
uutils follows Rust's release channels and is tested against stable, beta and
|
||||
nightly. The current Minimum Supported Rust Version (MSRV) is `1.82.0`.
|
||||
nightly. The current Minimum Supported Rust Version (MSRV) is `1.85.0`.
|
||||
|
||||
## Building
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ pub fn main() {
|
||||
match krate.as_ref() {
|
||||
"default" | "macos" | "unix" | "windows" | "selinux" | "zip" => continue, // common/standard feature names
|
||||
"nightly" | "test_unimplemented" | "expensive_tests" | "test_risky_names" => {
|
||||
continue
|
||||
continue;
|
||||
} // crate-local custom features
|
||||
"uudoc" => continue, // is not a utility
|
||||
"test" => continue, // over-ridden with 'uu_test' to avoid collision with rust core crate 'test'
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
name = "uucore-fuzz"
|
||||
version = "0.0.0"
|
||||
publish = false
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
@@ -69,7 +69,9 @@ fuzz_target!(|_data: &[u8]| {
|
||||
// Use C locale to avoid false positives, like in https://github.com/uutils/coreutils/issues/5378,
|
||||
// because uutils expr doesn't support localization yet
|
||||
// TODO remove once uutils expr supports localization
|
||||
env::set_var("LC_COLLATE", "C");
|
||||
unsafe {
|
||||
env::set_var("LC_COLLATE", "C");
|
||||
}
|
||||
let rust_result = generate_and_run_uumain(&args, uumain, None);
|
||||
|
||||
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false, None) {
|
||||
|
||||
@@ -84,7 +84,9 @@ fuzz_target!(|_data: &[u8]| {
|
||||
let rust_result = generate_and_run_uumain(&args, uumain, None);
|
||||
|
||||
// TODO remove once uutils printf supports localization
|
||||
env::set_var("LC_ALL", "C");
|
||||
unsafe {
|
||||
env::set_var("LC_ALL", "C");
|
||||
}
|
||||
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false, None) {
|
||||
Ok(result) => result,
|
||||
Err(error_result) => {
|
||||
|
||||
@@ -60,7 +60,9 @@ fuzz_target!(|_data: &[u8]| {
|
||||
let rust_result = generate_and_run_uumain(&args, uumain, Some(&input_lines));
|
||||
|
||||
// TODO remove once uutils sort supports localization
|
||||
env::set_var("LC_ALL", "C");
|
||||
unsafe {
|
||||
env::set_var("LC_ALL", "C");
|
||||
}
|
||||
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false, Some(&input_lines)) {
|
||||
Ok(result) => result,
|
||||
Err(error_result) => {
|
||||
|
||||
+3
-1
@@ -23,7 +23,9 @@ fn main() -> io::Result<()> {
|
||||
|
||||
if tldr_zip.is_none() {
|
||||
println!("Warning: No tldr archive found, so the documentation will not include examples.");
|
||||
println!("To include examples in the documentation, download the tldr archive and put it in the docs/ folder.");
|
||||
println!(
|
||||
"To include examples in the documentation, download the tldr archive and put it in the docs/ folder."
|
||||
);
|
||||
println!();
|
||||
println!(" curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip");
|
||||
println!();
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/arch"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/base32"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ use std::io::{self, ErrorKind, Read, Seek, SeekFrom};
|
||||
use std::path::{Path, PathBuf};
|
||||
use uucore::display::Quotable;
|
||||
use uucore::encoding::{
|
||||
for_base_common::{BASE32, BASE32HEX, BASE64, BASE64URL, BASE64_NOPAD, HEXUPPER_PERMISSIVE},
|
||||
Format, Z85Wrapper, BASE2LSBF, BASE2MSBF,
|
||||
BASE2LSBF, BASE2MSBF, Format, Z85Wrapper,
|
||||
for_base_common::{BASE32, BASE32HEX, BASE64, BASE64_NOPAD, BASE64URL, HEXUPPER_PERMISSIVE},
|
||||
};
|
||||
use uucore::encoding::{EncodingWrapper, SupportsFastDecodeAndEncode};
|
||||
use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
|
||||
@@ -291,7 +291,7 @@ pub fn get_supports_fast_decode_and_encode(
|
||||
}
|
||||
|
||||
pub mod fast_encode {
|
||||
use crate::base_common::{format_read_error, WRAP_DEFAULT};
|
||||
use crate::base_common::{WRAP_DEFAULT, format_read_error};
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
io::{self, ErrorKind, Read, Write},
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/base64"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/basename"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// spell-checker:ignore (ToDO) fullname
|
||||
|
||||
use clap::{Arg, ArgAction, Command};
|
||||
use std::path::{is_separator, PathBuf};
|
||||
use std::path::{PathBuf, is_separator};
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::{UResult, UUsageError};
|
||||
use uucore::line_ending::LineEnding;
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/basenc"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// spell-checker:ignore lsbf msbf
|
||||
|
||||
use clap::{Arg, ArgAction, Command};
|
||||
use uu_base32::base_common::{self, Config, BASE_CMD_PARSE_ERROR};
|
||||
use uu_base32::base_common::{self, BASE_CMD_PARSE_ERROR, Config};
|
||||
use uucore::error::UClapError;
|
||||
use uucore::{
|
||||
encoding::Format,
|
||||
|
||||
@@ -9,7 +9,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/cat"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
+5
-13
@@ -4,7 +4,7 @@
|
||||
// file that was distributed with this source code.
|
||||
|
||||
// spell-checker:ignore (ToDO) nonprint nonblank nonprinting ELOOP
|
||||
use std::fs::{metadata, File};
|
||||
use std::fs::{File, metadata};
|
||||
use std::io::{self, BufWriter, IsTerminal, Read, Write};
|
||||
/// Unix domain socket support
|
||||
#[cfg(unix)]
|
||||
@@ -18,7 +18,7 @@ use std::os::unix::net::UnixStream;
|
||||
|
||||
use clap::{Arg, ArgAction, Command};
|
||||
#[cfg(unix)]
|
||||
use nix::fcntl::{fcntl, FcntlArg};
|
||||
use nix::fcntl::{FcntlArg, fcntl};
|
||||
use thiserror::Error;
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::UResult;
|
||||
@@ -83,19 +83,11 @@ struct OutputOptions {
|
||||
|
||||
impl OutputOptions {
|
||||
fn tab(&self) -> &'static str {
|
||||
if self.show_tabs {
|
||||
"^I"
|
||||
} else {
|
||||
"\t"
|
||||
}
|
||||
if self.show_tabs { "^I" } else { "\t" }
|
||||
}
|
||||
|
||||
fn end_of_line(&self) -> &'static str {
|
||||
if self.show_ends {
|
||||
"$\n"
|
||||
} else {
|
||||
"\n"
|
||||
}
|
||||
if self.show_ends { "$\n" } else { "\n" }
|
||||
}
|
||||
|
||||
/// We can write fast if we can simply copy the contents of the file to
|
||||
@@ -694,7 +686,7 @@ fn write_end_of_line<W: Write>(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::io::{stdout, BufWriter};
|
||||
use std::io::{BufWriter, stdout};
|
||||
|
||||
#[test]
|
||||
fn test_write_nonprint_to_end_new_line() {
|
||||
|
||||
@@ -8,7 +8,7 @@ homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/main/src/uu/chcon"
|
||||
keywords = ["coreutils", "uutils", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
readme.workspace = true
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user