Skip to content

Commit f292b76

Browse files
authored
style: fix lints from Rust 1.87 (#1063)
* style: allow clippy::large_enum_variant * style: fix clippy::double_ended_iterator_last * style: fix clippy::io_other_error
1 parent 91c0d49 commit f292b76

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

builder/src/arch/apple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub const RUSTFLAGS: [&str; 2] = ["-C", "relocation-model=pic"];
1818

1919
pub fn fix_rpath(lib_path: &str) {
2020
if REMOVE_RPATH {
21-
let lib_name = lib_path.split('/').last().unwrap();
21+
let lib_name = lib_path.split('/').next_back().unwrap();
2222

2323
let exit_status = Command::new("install_name_tool")
2424
.arg("-id")

datadog-live-debugger/src/probe_defs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ pub struct ServiceConfiguration {
151151
pub sampling_snapshots_per_second: u32,
152152
}
153153

154+
#[allow(clippy::large_enum_variant)]
154155
#[derive(Debug)]
155156
pub enum LiveDebuggingData {
156157
Probe(Probe),

datadog-sidecar/src/shm_remote_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ pub struct RemoteConfigManager {
400400
pub current_runtime_id: String,
401401
}
402402

403+
#[allow(clippy::large_enum_variant)]
403404
#[derive(Debug)]
404405
pub enum RemoteConfigUpdate {
405406
None,

spawn_worker/src/unix/spawn.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,15 @@ impl Target {
134134
let default_method = SpawnMethod::Exec;
135135

136136
let target_path = match self {
137-
Target::Entrypoint(e) => e.get_fs_path().ok_or_else(|| {
138-
std::io::Error::new(
139-
std::io::ErrorKind::Other,
140-
"can't find the entrypoint's target path",
141-
)
142-
}),
137+
Target::Entrypoint(e) => e
138+
.get_fs_path()
139+
.ok_or_else(|| std::io::Error::other("can't find the entrypoint's target path")),
143140
Target::ManualTrampoline(p, _) => Ok(std::path::PathBuf::from(p)),
144141
Target::Noop => return Ok(default_method),
145142
}?;
146-
let target_filename = target_path.file_name().ok_or_else(|| {
147-
std::io::Error::new(
148-
std::io::ErrorKind::Other,
149-
"can't extract actual target filename",
150-
)
151-
})?;
143+
let target_filename = target_path
144+
.file_name()
145+
.ok_or_else(|| std::io::Error::other("can't extract actual target filename"))?;
152146

153147
// simple heuristic that should cover most cases
154148
// if both executable path and target's entrypoint path end up having the same filenames

0 commit comments

Comments
 (0)