Skip to content

Commit 134b715

Browse files
committed
chore: switch to Rust 2024 edition
1 parent 6f2a60f commit 134b715

File tree

18 files changed

+25
-20
lines changed

18 files changed

+25
-20
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma"
33
version = "1.15.0-alpha.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "User-friendly and performant package manager for APT repositories"
66
license = "GPL-3.0-or-later"
77
authors = ["eatradish <sakiiily@aosc.io>"]

apt-auth-config/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "apt-auth-config"
33
version = "0.3.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "Library to parse APT auth.conf.d configurations"
66
license = "MIT"
77

oma-console/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-console"
33
version = "0.26.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "Console and terminal emulator handling library used by oma"
66
license = "MIT"
77

oma-contents/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-contents"
33
version = "0.16.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "APT Contents metadata handling library"
66
license = "MIT"
77

oma-fetch/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-fetch"
33
version = "0.25.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "APT repository download routines library"
66
license = "MIT"
77

oma-history/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-history"
33
version = "0.5.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "Package manager operations history database management library"
66
license = "MIT"
77

oma-mirror/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-mirror"
33
version = "0.3.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "Library to handle AOSC OS APT configuration (sources.list)"
66
license = "MIT"
77

oma-pm-operation-type/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-pm-operation-type"
33
version = "0.8.0"
4-
edition = "2021"
4+
edition = "2024"
55
license = "MIT"
66
description = "APT package management operation abstraction library"
77

oma-pm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-pm"
33
version = "0.46.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "APT package manager API abstraction library"
66
license = "GPL-3.0-or-later"
77

oma-pm/src/apt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl OmaApt {
330330
}
331331

332332
if yes || force_yes {
333-
std::env::set_var("DEBIAN_FRONTEND", "noninteractive");
333+
unsafe { std::env::set_var("DEBIAN_FRONTEND", "noninteractive") };
334334
}
335335

336336
let dir = config.get("Dir").unwrap_or("/".to_owned());

oma-pm/src/progress.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl OmaAptInstallProgress {
4040
} = args;
4141

4242
if pm.no_interactive() {
43-
std::env::set_var("DEBIAN_FRONTEND", "noninteractive");
43+
unsafe { std::env::set_var("DEBIAN_FRONTEND", "noninteractive") };
4444
}
4545

4646
if !pm.use_pty() {

oma-refresh/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-refresh"
33
version = "0.41.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "APT repository refresh handler library"
66
license = "GPL-3.0-or-later"
77

oma-repo-verify/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-repo-verify"
33
version = "0.5.1"
4-
edition = "2021"
4+
edition = "2024"
55
description = "Handle APT repository verify library"
66
license = "MIT"
77

oma-topics/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-topics"
33
version = "0.21.0"
4-
edition = "2021"
4+
edition = "2024"
55
description = "AOSC OS topic (testing) repository manager used by oma"
66
license = "MIT"
77

oma-utils/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "oma-utils"
33
version = "0.10.5"
4-
edition = "2021"
4+
edition = "2024"
55
description = "General system API and utilities used by oma"
66
license = "MIT"
77

src/error.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ impl<'a> Iterator for Chain<'a> {
9898
impl DoubleEndedIterator for Chain<'_> {
9999
fn next_back(&mut self) -> Option<Self::Item> {
100100
match &mut self.state {
101-
Linked { mut next } => {
101+
Linked { next } => {
102+
let mut next = next.to_owned();
102103
let mut rest = Vec::new();
103104
while let Some(cause) = next {
104105
next = cause.source();
@@ -109,16 +110,20 @@ impl DoubleEndedIterator for Chain<'_> {
109110
self.state = Buffered { rest };
110111
last
111112
}
112-
Buffered { rest } => rest.next_back(),
113+
Buffered { rest } => {
114+
let mut rest = rest.to_owned();
115+
rest.next_back()
116+
}
113117
}
114118
}
115119
}
116120

117121
impl ExactSizeIterator for Chain<'_> {
118122
fn len(&self) -> usize {
119123
match &self.state {
120-
Linked { mut next } => {
124+
Linked { next } => {
121125
let mut len = 0;
126+
let mut next = next.to_owned();
122127
while let Some(cause) = next {
123128
next = cause.source();
124129
len += 1;

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ fn init_color_formatter(oma: &OhManagerAilurus, config: &Config) {
285285
let no_color = oma.global.color == ColorChoice::Never;
286286

287287
if no_color {
288-
env::set_var("NO_COLOR", "1");
288+
unsafe { env::set_var("NO_COLOR", "1") };
289289
}
290290

291291
COLOR_FORMATTER.get_or_init(|| {

src/tui/tui_inner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl Display for Operation {
7272
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7373
match self {
7474
Operation::Package { name, version } => {
75-
if let Some(ref ver) = version {
75+
if let Some(ver) = version {
7676
writeln!(f, "+ {} ({})", name, ver)?;
7777
} else {
7878
writeln!(f, "- {}", name)?;

0 commit comments

Comments
 (0)