Stop using 'object' terminology!

This commit is contained in:
Ben S
2016-01-26 18:55:21 +00:00
parent 2dc3ef0a16
commit 543925889c
+8 -4
View File
@@ -316,12 +316,14 @@ unsafe fn members(groups: *const *const c_char) -> Vec<String> {
}
/// 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 systems user database.
/// Returns it if one is found, otherwise returns `None`.
pub fn get_user_by_uid(uid: uid_t) -> Option<User> {
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 systems user database.
/// Returns it if one is found, otherwise returns `None`.
pub fn get_user_by_name(username: &str) -> Option<User> {
let username_c = CString::new(username);
@@ -334,12 +336,14 @@ pub fn get_user_by_name(username: &str) -> Option<User> {
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 systems group database.
/// Returns it if one is found, otherwise returns `None`.
pub fn get_group_by_gid(gid: gid_t) -> Option<Group> {
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 systems group database.
/// Returns it if one is found, otherwise returns `None`.
pub fn get_group_by_name(group_name: &str) -> Option<Group> {
let group_name_c = CString::new(group_name);