Skip to content

Commit 99b77f6

Browse files
generatedunixname89002005320881meta-codesync[bot]
authored andcommitted
[QuickReview][Codemod][Lint:fbsource:RUSTFIX:clippy::io_other_error] Fix clippy::io_other_error issues in fbcode/antlir/antlir2/libcap/src
Reviewed By: dtolnay Differential Revision: D89443719 fbshipit-source-id: ee44674f9b906797b714f1aea8d77acce2efa9cb
1 parent 3510a12 commit 99b77f6

File tree

1 file changed

+2
-3
lines changed
  • antlir/antlir2/libcap/src

1 file changed

+2
-3
lines changed

antlir/antlir2/libcap/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ impl FromStr for Capabilities {
9797
type Err = std::io::Error;
9898

9999
fn from_str(s: &str) -> Result<Self> {
100-
let cstr = CString::new(s).map_err(|_| {
101-
std::io::Error::new(std::io::ErrorKind::Other, "string had interior NUL byte")
102-
})?;
100+
let cstr =
101+
CString::new(s).map_err(|_| std::io::Error::other("string had interior NUL byte"))?;
103102
let cap = unsafe { libcap_sys::cap_from_text(cstr.as_ptr()) };
104103
if cap.is_null() {
105104
Err(std::io::Error::last_os_error())

0 commit comments

Comments
 (0)