diff options
author | Zach Reizner <zachr@google.com> | 2018-10-03 10:22:32 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-09 21:14:05 -0700 |
commit | 55a9e504beef368bd97e51ffd5a7fa6c034eb8ad (patch) | |
tree | 894d8685e2fdfa105ea35d1cb6cfceee06502c7a /sys_util/src/passwd.rs | |
parent | 046df60760f3b0691f23c27a7f24a96c9afe8c05 (diff) | |
download | crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.gz crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.bz2 crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.lz crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.xz crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.zst crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.zip |
cargo fmt all source code
Now that cargo fmt has landed, run it over everything at once to bring rust source to the standard formatting. TEST=cargo test BUG=None Change-Id: Ic95a48725e5a40dcbd33ba6d5aef2bd01e91865b Reviewed-on: https://chromium-review.googlesource.com/1259287 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'sys_util/src/passwd.rs')
-rw-r--r-- | sys_util/src/passwd.rs | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/sys_util/src/passwd.rs b/sys_util/src/passwd.rs index 215cdd3..7181ba0 100644 --- a/sys_util/src/passwd.rs +++ b/sys_util/src/passwd.rs @@ -9,9 +9,9 @@ use std::mem; use std::ptr; use libc; -use libc::{c_char, gid_t, uid_t, getgrnam_r, getpwnam_r}; +use libc::{c_char, getgrnam_r, getpwnam_r, gid_t, uid_t}; -use {Result, errno_result}; +use {errno_result, Result}; /// Safe wrapper for getting a uid from a user name with `getpwnam_r(3)`. #[inline(always)] @@ -29,11 +29,13 @@ pub fn get_user_id(user_name: &CStr) -> Result<uid_t> { // This call is safe as long as it behaves as described in the man page. We pass in valid // pointers to stack-allocated buffers, and the length check for the scratch buffer is correct. unsafe { - handle_eintr_rc!(getpwnam_r(user_name.as_ptr(), - &mut passwd, - buf.as_mut_ptr(), - buf.len(), - &mut passwd_result)) + handle_eintr_rc!(getpwnam_r( + user_name.as_ptr(), + &mut passwd, + buf.as_mut_ptr(), + buf.len(), + &mut passwd_result + )) }; if passwd_result.is_null() { @@ -59,11 +61,13 @@ pub fn get_group_id(group_name: &CStr) -> Result<gid_t> { // This call is safe as long as it behaves as described in the man page. We pass in valid // pointers to stack-allocated buffers, and the length check for the scratch buffer is correct. unsafe { - handle_eintr_rc!(getgrnam_r(group_name.as_ptr(), - &mut group, - buf.as_mut_ptr(), - buf.len(), - &mut group_result)) + handle_eintr_rc!(getgrnam_r( + group_name.as_ptr(), + &mut group, + buf.as_mut_ptr(), + buf.len(), + &mut group_result + )) }; if group_result.is_null() { |