Conversation
|
GNU testsuite comparison: |
src/uu/chroot/src/chroot.rs
Outdated
| /// error is returned. | ||
| fn parse_userspec(spec: &str) -> UResult<UserSpec> { | ||
| match &spec.splitn(2, ':').collect::<Vec<&str>>()[..] { | ||
| let mut parts = spec.splitn(2, ':'); |
There was a problem hiding this comment.
Wouldn't it be cleaner to use split_once?
There was a problem hiding this comment.
@cakebaker thx, good idea. The issue that I uncovered though is that the ChrootError::InvalidUserspec will never be produced -- all userspec values are valid?!
f255cc7 to
7c722ae
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
@sylvestre @cakebaker so what's the proper solution for the bug uncovered by this PR, i.e. that |
b771d98 to
27f41a5
Compare
|
GNU testsuite comparison: |
I don't think I'm able to get anything but "invalid user" or "invalid group" from GNU here, so it's probably fine to let the group parsing later deal with it. |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
There is no need to allocate a vector when matching a sequence of items
|
GNU testsuite comparison: |
feat: optimize iter matching
InvalidUserspecerror