Skip to content

Commit 5f46631

Browse files
committed
Improve from_anything definition using where clause
Signed-off-by: Otavio Salvador <[email protected]>
1 parent b3d7716 commit 5f46631

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/unistd.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,11 +2459,12 @@ impl From<&libc::passwd> for User {
24592459
}
24602460

24612461
impl User {
2462-
fn from_anything(f: impl Fn(*mut libc::passwd,
2463-
*mut libc::c_char,
2464-
libc::size_t,
2465-
*mut *mut libc::passwd) -> libc::c_int)
2466-
-> Result<Option<Self>>
2462+
fn from_anything<F>(f: F) -> Result<Option<Self>>
2463+
where
2464+
F: Fn(*mut libc::passwd,
2465+
*mut libc::c_char,
2466+
libc::size_t,
2467+
*mut *mut libc::passwd) -> libc::c_int
24672468
{
24682469
let bufsize = match sysconf(SysconfVar::GETPW_R_SIZE_MAX) {
24692470
Ok(Some(n)) => n as usize,

0 commit comments

Comments
 (0)