Skip to content

Commit ab4f10c

Browse files
authored
feat: update to edition 2024, fix deprecated warnings (#299)
* feat: update to edition 2024, fix deprecated warnings Signed-off-by: Keming <[email protected]> * fix lint Signed-off-by: Keming <[email protected]> --------- Signed-off-by: Keming <[email protected]>
1 parent cfbc83b commit ab4f10c

File tree

26 files changed

+473
-551
lines changed

26 files changed

+473
-551
lines changed

Cargo.lock

Lines changed: 385 additions & 484 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commands/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "horust-commands-lib"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
authors = ["Federico Ponzi <[email protected]>"]
66
description = "A complete supervisor and init system, designed for running in containers."
77
license = "MIT"
@@ -11,7 +11,7 @@ readme = "README.md"
1111
keywords = ["init", "container", "supervisor"]
1212
categories = ["command-line-utilities"]
1313
include = ["src/**/*", "Cargo.*", "../LICENSE.txt", "README.md"]
14-
rust-version = "1.74.1"
14+
rust-version = "1.85.1"
1515

1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

commands/src/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::proto::messages::horust_msg_message::MessageType;
22
use crate::proto::messages::{
3-
horust_msg_request, horust_msg_response, HorustMsgMessage, HorustMsgRequest,
4-
HorustMsgServiceStatusRequest,
3+
HorustMsgMessage, HorustMsgRequest, HorustMsgServiceStatusRequest, horust_msg_request,
4+
horust_msg_response,
55
};
66
use crate::{HorustMsgServiceStatus, UdsConnectionHandler};
7-
use anyhow::{anyhow, Context};
8-
use anyhow::{bail, Result};
7+
use anyhow::{Context, anyhow};
8+
use anyhow::{Result, bail};
99
use log::{debug, info};
1010
use std::net::Shutdown;
1111
use std::os::unix::net::UnixStream;

commands/src/server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use crate::UdsConnectionHandler;
12
use crate::proto::messages::horust_msg_message::MessageType::Request;
23
use crate::proto::messages::{
3-
horust_msg_message, horust_msg_request, horust_msg_response, HorustMsgError, HorustMsgMessage,
4-
HorustMsgRequest, HorustMsgResponse, HorustMsgServiceStatus, HorustMsgServiceStatusResponse,
4+
HorustMsgError, HorustMsgMessage, HorustMsgRequest, HorustMsgResponse, HorustMsgServiceStatus,
5+
HorustMsgServiceStatusResponse, horust_msg_message, horust_msg_request, horust_msg_response,
56
};
6-
use crate::UdsConnectionHandler;
7-
use anyhow::{anyhow, Result};
7+
use anyhow::{Result, anyhow};
88
use log::{error, info};
99
use std::io::ErrorKind;
1010
use std::os::unix::net::UnixListener;

horust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name = "horust"
33
version = "0.1.11"
44
authors = ["Federico Ponzi <[email protected]>"]
55
description = "A complete supervisor and init system, designed for running in containers."
6-
edition = "2021"
6+
edition = "2024"
77
license = "MIT"
88
repository = "https://github.com/FedericoPonzi/horust"
99
homepage = "https://github.com/FedericoPonzi/horust"
1010
readme = "../README.md"
1111
keywords = ["init", "container", "supervisor"]
1212
categories = ["command-line-utilities"]
1313
include = ["src/**/*", "Cargo.*", "LICENSE.txt", "example_services/**/*"]
14-
rust-version = "1.74.1"
14+
rust-version = "1.85.1"
1515

1616
[dependencies]
1717
clap = { version = "~4.5", features = ["derive"] }

horust/src/horust/bus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111
sync::{Arc, Mutex},
1212
};
1313

14-
use crossbeam::channel::{unbounded, Receiver, Sender};
14+
use crossbeam::channel::{Receiver, Sender, unbounded};
1515

1616
/// Bus state shared between `Bus` and all `BusConnector` instances.
1717
/// It contains all necessary components to send data and join the bus.

horust/src/horust/commands_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::horust::Event;
12
use crate::horust::bus::BusConnector;
23
use crate::horust::formats::{ServiceName, ServiceStatus};
3-
use crate::horust::Event;
4-
use anyhow::{anyhow, Result};
4+
use anyhow::{Result, anyhow};
55
use horust_commands_lib::{CommandsHandlerTrait, HorustMsgServiceStatus};
66
use std::collections::HashMap;
77
use std::os::unix::net::UnixListener;

horust/src/horust/formats/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ impl ResourceLimit {
660660
#[cfg(target_os = "linux")]
661661
pub(crate) fn apply(&self, name: &str, pid: unistd::Pid) -> anyhow::Result<()> {
662662
use libcgroups::common::{
663-
create_cgroup_manager, CgroupConfig, CgroupManager, ControllerOpt, DEFAULT_CGROUP_ROOT,
663+
CgroupConfig, CgroupManager, ControllerOpt, DEFAULT_CGROUP_ROOT, create_cgroup_manager,
664664
};
665665
use oci_spec::runtime::{
666666
LinuxCpuBuilder, LinuxMemoryBuilder, LinuxPidsBuilder, LinuxResources,
@@ -770,8 +770,8 @@ mod test {
770770

771771
use crate::horust::formats::ResourceLimit;
772772
use crate::horust::formats::{
773-
validate, Environment, Failure, FailureStrategy, Healthiness, Restart, RestartStrategy,
774-
Service, Termination, TerminationSignal::TERM,
773+
Environment, Failure, FailureStrategy, Healthiness, Restart, RestartStrategy, Service,
774+
Termination, TerminationSignal::TERM, validate,
775775
};
776776
use crate::horust::get_sample_service;
777777

horust/src/horust/healthcheck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::thread;
55
use std::thread::JoinHandle;
66
use std::time::Duration;
77

8-
use crossbeam::channel::{unbounded, Receiver, RecvTimeoutError, Sender};
8+
use crossbeam::channel::{Receiver, RecvTimeoutError, Sender, unbounded};
99

1010
use checks::*;
1111

horust/src/horust/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use std::path::{Path, PathBuf};
66
use anyhow::Result;
77
use bus::BusConnector;
88
#[cfg(target_os = "linux")]
9-
use libc::{prctl, PR_SET_CHILD_SUBREAPER};
9+
use libc::{PR_SET_CHILD_SUBREAPER, prctl};
1010

1111
pub use formats::Event;
1212

1313
use crate::horust::bus::Bus;
14-
use crate::horust::formats::{validate, Service};
14+
use crate::horust::formats::{Service, validate};
1515

16-
pub use self::formats::{get_sample_service, ExitStatus, HorustConfig};
16+
pub use self::formats::{ExitStatus, HorustConfig, get_sample_service};
1717

1818
pub mod bus;
1919
mod commands_handler;

0 commit comments

Comments
 (0)