Closed
Description
Documentation says:
Lines 176 to 177 in 6123083
but code unconditionally returns Some()
:
Lines 209 to 212 in 6123083
This documentation is leftover from the old PR code which did return None
:
Errno::result(res).map(|_| {
(if rlim.rlim_cur != RLIM_INFINITY { Some(rlim.rlim_cur) } else { None },
if rlim.rlim_max != RLIM_INFINITY { Some(rlim.rlim_max) } else { None })
})
... but the new PR removed that branch.
It would be nice to not return Option
from getrlimit
at least, since it makes the caller code more annoying when we only want to call setrlimit
when we need to, which requires comparing the returned soft limit vs the returned hard limit. And if getrlimit
is changed to not special-case INFINITY
, the special-case might as well be removed from setrlimit
too so that one doesn't need to Some()
-wrap the values when passing them from getrlimit
to setrlimit
.
Metadata
Metadata
Assignees
Labels
No labels