From 5f46631dad741620c0eeb5145a83eaabc49313c5 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 28 Aug 2019 17:56:51 -0300 Subject: [PATCH] Improve `from_anything` definition using where clause Signed-off-by: Otavio Salvador --- src/unistd.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/unistd.rs b/src/unistd.rs index 7381dc3612..4cd1d60a46 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -2459,11 +2459,12 @@ impl From<&libc::passwd> for User { } impl User { - fn from_anything(f: impl Fn(*mut libc::passwd, - *mut libc::c_char, - libc::size_t, - *mut *mut libc::passwd) -> libc::c_int) - -> Result> + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::passwd, + *mut libc::c_char, + libc::size_t, + *mut *mut libc::passwd) -> libc::c_int { let bufsize = match sysconf(SysconfVar::GETPW_R_SIZE_MAX) { Ok(Some(n)) => n as usize,