Skip to content

Commit c017285

Browse files
authored
Add doc aliases for getpw{nam,uid} (#2560)
1 parent 5c80884 commit c017285

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/unistd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,7 @@ impl User {
37323732
/// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap();
37333733
/// assert_eq!(res.name, "root");
37343734
/// ```
3735+
#[doc(alias("getpwuid", "getpwuid_r"))]
37353736
pub fn from_uid(uid: Uid) -> Result<Option<Self>> {
37363737
// SAFETY: `getpwuid_r` will write to `res` if it initializes the value
37373738
// at `pwd`.
@@ -3755,6 +3756,7 @@ impl User {
37553756
/// let res = User::from_name("root").unwrap().unwrap();
37563757
/// assert_eq!(res.name, "root");
37573758
/// ```
3759+
#[doc(alias("getpwnam", "getpwnam_r"))]
37583760
pub fn from_name(name: &str) -> Result<Option<Self>> {
37593761
let name = match CString::new(name) {
37603762
Ok(c_str) => c_str,

0 commit comments

Comments
 (0)