Skip to content

Commit dd8ce7d

Browse files
committed
Compare self with ROOT constant in is_root() method.
1 parent c0655aa commit dd8ce7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unistd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Uid {
4141

4242
/// Returns true if the `Uid` represents privileged user - root. (If it equals zero.)
4343
pub fn is_root(&self) -> bool {
44-
self.0 == 0
44+
*self == ROOT
4545
}
4646
}
4747

0 commit comments

Comments
 (0)