1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-10-30 23:17:47 +02:00

rust: move to Rust 2024

I'd like to use let chains.

Probably this isn't necessary to do for every crate, but I don't feel
like maintaining a mismash.
This commit is contained in:
Andrew Gallant
2025-09-07 15:07:45 -04:00
parent 3f565b58cc
commit a60e62d9ac
14 changed files with 16 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ exclude = [
]
build = "build.rs"
autotests = false
edition = "2021"
edition = "2024"
rust-version = "1.88"
[[bin]]

View File

@@ -11,7 +11,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/cli"
readme = "README.md"
keywords = ["regex", "grep", "cli", "utility", "util"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[dependencies]
bstr = { version = "1.6.2", features = ["std"] }

View File

@@ -798,7 +798,7 @@ impl HiArgs {
attach_timestamps(haystacks, |md| md.created()).collect()
}
};
with_timestamps.sort_by(|(_, ref t1), (_, ref t2)| {
with_timestamps.sort_by(|(_, t1), (_, t2)| {
let ordering = match (*t1, *t2) {
// Both have metadata, do the obvious thing.
(Some(t1), Some(t2)) => t1.cmp(&t2),
@@ -1188,7 +1188,7 @@ fn types(low: &LowArgs) -> anyhow::Result<ignore::types::Types> {
let mut builder = ignore::types::TypesBuilder::new();
builder.add_defaults();
for tychange in low.type_changes.iter() {
match tychange {
match *tychange {
TypeChange::Clear { ref name } => {
builder.clear(name);
}

View File

@@ -13,7 +13,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/globset"
readme = "README.md"
keywords = ["regex", "glob", "multiple", "set", "pattern"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[lib]
name = "globset"

View File

@@ -11,7 +11,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/grep"
readme = "README.md"
keywords = ["regex", "grep", "egrep", "search", "pattern"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[dependencies]
grep-cli = { version = "0.1.11", path = "../cli" }

View File

@@ -12,7 +12,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore"
readme = "README.md"
keywords = ["glob", "ignore", "gitignore", "pattern", "file"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[lib]
name = "ignore"

View File

@@ -12,7 +12,7 @@ readme = "README.md"
keywords = ["regex", "pattern", "trait"]
license = "Unlicense OR MIT"
autotests = false
edition = "2021"
edition = "2024"
[dependencies]
memchr = "2.6.3"

View File

@@ -11,7 +11,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/pcre2"
readme = "README.md"
keywords = ["regex", "grep", "pcre", "backreference", "look"]
license = "Unlicense OR MIT"
edition = "2018"
edition = "2024"
[dependencies]
grep-matcher = { version = "0.1.7", path = "../matcher" }

View File

@@ -12,7 +12,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/printer"
readme = "README.md"
keywords = ["grep", "pattern", "print", "printer", "sink"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[features]
default = ["serde"]

View File

@@ -482,7 +482,7 @@ impl FormatBuilder {
let err_invalid_scheme = HyperlinkFormatError {
kind: HyperlinkFormatErrorKind::InvalidScheme,
};
let Some(Part::Text(ref part)) = self.parts.first() else {
let Some(Part::Text(part)) = self.parts.first() else {
return Err(err_invalid_scheme);
};
let Some(colon) = part.find_byte(b':') else {
@@ -538,7 +538,7 @@ impl Part {
values: &Values,
dest: &mut Vec<u8>,
) {
match self {
match *self {
Part::Text(ref text) => dest.extend_from_slice(text),
Part::Host => dest.extend_from_slice(
env.host.as_ref().map(|s| s.as_bytes()).unwrap_or(b""),

View File

@@ -11,7 +11,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/regex"
readme = "README.md"
keywords = ["regex", "grep", "search", "pattern", "line"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[dependencies]
bstr = "1.6.2"

View File

@@ -9,7 +9,7 @@ pub(crate) fn check(expr: &Hir, byte: u8) -> Result<(), Error> {
assert!(byte.is_ascii(), "ban byte must be ASCII");
let ch = char::from(byte);
let invalid = || Err(Error::new(ErrorKind::Banned(byte)));
match expr.kind() {
match *expr.kind() {
HirKind::Empty => {}
HirKind::Literal(hir::Literal(ref lit)) => {
if lit.iter().find(|&&b| b == byte).is_some() {

View File

@@ -11,7 +11,7 @@ repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/searcher"
readme = "README.md"
keywords = ["regex", "grep", "egrep", "search", "pattern"]
license = "Unlicense OR MIT"
edition = "2021"
edition = "2024"
[dependencies]
bstr = { version = "1.6.2", default-features = false, features = ["std"] }

View File

@@ -2,7 +2,7 @@
name = "fuzz"
version = "0.0.1"
publish = false
edition = "2021"
edition = "2024"
[package.metadata]
cargo-fuzz = true