From 543925889c9a78b224376195244edb43aef8a82a Mon Sep 17 00:00:00 2001 From: Ben S Date: Tue, 26 Jan 2016 18:39:00 +0000 Subject: [PATCH] Stop using 'object' terminology! --- src/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 92a6875..5472f7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -316,12 +316,14 @@ unsafe fn members(groups: *const *const c_char) -> Vec { } -/// Returns a User object if one exists for the given user ID; otherwise, return None. +/// Searches for a `User` with the given ID in the system’s user database. +/// Returns it if one is found, otherwise returns `None`. pub fn get_user_by_uid(uid: uid_t) -> Option { unsafe { passwd_to_user(getpwuid(uid)) } } -/// Returns a User object if one exists for the given username; otherwise, return None. +/// Searches for a `User` with the given username in the system’s user database. +/// Returns it if one is found, otherwise returns `None`. pub fn get_user_by_name(username: &str) -> Option { let username_c = CString::new(username); @@ -334,12 +336,14 @@ pub fn get_user_by_name(username: &str) -> Option { unsafe { passwd_to_user(getpwnam(username_c.unwrap().as_ptr())) } } -/// Returns a Group object if one exists for the given group ID; otherwise, return None. +/// Searches for a `Group` with the given ID in the system’s group database. +/// Returns it if one is found, otherwise returns `None`. pub fn get_group_by_gid(gid: gid_t) -> Option { unsafe { struct_to_group(getgrgid(gid)) } } -/// Returns a Group object if one exists for the given groupname; otherwise, return None. +/// Searches for a `Group` with the given group name in the system‘s group database. +/// Returns it if one is found, otherwise returns `None`. pub fn get_group_by_name(group_name: &str) -> Option { let group_name_c = CString::new(group_name);