mirror of
https://github.com/starship/starship.git
synced 2024-11-07 08:54:50 +01:00
Default to false for tests regardless of the OS
Checking for username along with cfg!(test) seems redundant, especially because of one edge case - root user can be renamed
This commit is contained in:
parent
44140502f3
commit
9628e133f6
@ -109,12 +109,12 @@ fn is_root_user() -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "windows", test))]
|
||||
#[cfg(test)]
|
||||
fn is_root_user() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
#[cfg(all(not(target_os = "windows"), not(test)))]
|
||||
fn is_root_user() -> bool {
|
||||
nix::unistd::geteuid() == nix::unistd::ROOT
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user