Skip to content

Commit ecaae11

Browse files
style(procmgr): apply cargo fmt
Fix rustfmt check failures in procmgr list/describe changes.
1 parent 6f91002 commit ecaae11

7 files changed

Lines changed: 10 additions & 24 deletions

File tree

pkg/procmgr/rust/src/grpc/service.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,7 @@ fn process_detail(proc: &ManagedProcess) -> proto::ProcessDetail {
349349
}
350350

351351
fn process_identity(proc: &ManagedProcess) -> (String, String) {
352-
(
353-
proc.profile().as_str().to_string(),
354-
proc.user().to_string(),
355-
)
352+
(proc.profile().as_str().to_string(), proc.user().to_string())
356353
}
357354

358355
#[cfg(test)]

pkg/procmgr/rust/src/platform/unix/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/).
44
// Copyright 2026-present Datadog, Inc.
55

6-
mod spawn;
76
mod runtime_user;
7+
mod spawn;
88

99
use nix::sys::signal::{self, Signal};
1010
use nix::unistd::Pid;
1111
use std::os::unix::process::ExitStatusExt;
1212
use std::path::PathBuf;
1313
use tokio::process::Command;
1414

15-
pub(crate) use spawn::spawn_child;
1615
pub(crate) use runtime_user::runtime_user_for_pid;
16+
pub(crate) use spawn::spawn_child;
1717

1818
/// Unix managed children run as the dd-procmgr supervisor account (`dd-agent`).
1919
pub(crate) fn spawn_user_display() -> &'static str {

pkg/procmgr/rust/src/platform/windows/account_name.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ mod tests {
6767
AccountName::new("", "ddagentuser").display(),
6868
r".\ddagentuser"
6969
);
70-
assert_eq!(
71-
AccountName::new("CORP", "gmsa$").display(),
72-
r"CORP\gmsa$"
73-
);
70+
assert_eq!(AccountName::new("CORP", "gmsa$").display(), r"CORP\gmsa$");
7471
}
7572
}

pkg/procmgr/rust/src/platform/windows/agent_credentials.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ impl AgentAccount {
6363
AgentAccount::LocalService => AccountName::local_service(),
6464
AgentAccount::NetworkService => AccountName::network_service(),
6565
AgentAccount::PasswordLogon { domain, user, .. }
66-
| AgentAccount::ServiceAccountLogon { domain, user } => {
67-
AccountName::new(domain, user)
68-
}
66+
| AgentAccount::ServiceAccountLogon { domain, user } => AccountName::new(domain, user),
6967
}
7068
}
7169
}
@@ -249,8 +247,8 @@ impl Drop for PolicyHandle {
249247

250248
#[cfg(test)]
251249
mod tests {
252-
use super::*;
253250
use super::super::account_name::AccountName;
251+
use super::*;
254252

255253
#[test]
256254
fn local_system_name_detection() {

pkg/procmgr/rust/src/platform/windows/runtime_user.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ fn open_process_token(process: &ProcessHandle) -> Result<TokenHandle> {
5757
fn token_user_sid(token: &TokenHandle) -> Result<Vec<u8>> {
5858
unsafe {
5959
let mut needed = 0u32;
60-
let _ = GetTokenInformation(
61-
token.0,
62-
TokenUser,
63-
ptr::null_mut(),
64-
0,
65-
&mut needed,
66-
);
60+
let _ = GetTokenInformation(token.0, TokenUser, ptr::null_mut(), 0, &mut needed);
6761
if needed == 0 {
6862
bail!("GetTokenInformation size query failed");
6963
}

pkg/procmgr/rust/src/spawn/identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ fn resolve_spawn_user(process_name: &str, profile: SpawnProfile) -> anyhow::Resu
3939

4040
#[cfg(test)]
4141
mod tests {
42-
use super::*;
4342
use super::super::profile::{SpawnProfile, profile_for};
43+
use super::*;
4444

4545
#[test]
4646
fn profile_for_trace_is_agent() {

pkg/procmgr/rust/src/spawn/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
//! Managed-process spawn: config → [`SpawnRequest`] → platform backend.
77
8-
mod profile;
98
mod identity;
9+
mod profile;
1010
mod request;
1111
mod stdio_setting;
1212

13+
pub(crate) use identity::spawn_user_for;
1314
#[cfg(windows)]
1415
pub(crate) use profile::DATADOG_AGENT_PROCESS;
1516
pub use profile::{SpawnProfile, profile_for};
16-
pub(crate) use identity::spawn_user_for;
1717
pub use request::SpawnRequest;
1818
pub(crate) use stdio_setting::StdioSetting;
1919

0 commit comments

Comments
 (0)