mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-26 01:57:32 +00:00
Move CString to where it's actually used
src/feature/xattr.rs:6:5: 6:22 warning: unused import, #[warn(unused_imports)] on by default src/feature/xattr.rs:6 use std::ffi::CString; ^~~~~~~~~~~~~~~~~
This commit is contained in:
parent
b35927f247
commit
92328d9093
@ -3,7 +3,6 @@ extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
use std::ffi::CString;
|
||||
|
||||
pub const ENABLED: bool = cfg!(feature="git") && cfg!(any(target_os="macos", target_os="linux"));
|
||||
|
||||
@ -51,6 +50,8 @@ pub struct Attribute {
|
||||
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
pub fn list_attrs(lister: lister::Lister, path: &Path) -> io::Result<Vec<Attribute>> {
|
||||
use std::ffi::CString;
|
||||
|
||||
let c_path = match path.to_str().and_then(|s| { CString::new(s).ok() }) {
|
||||
Some(cstring) => cstring,
|
||||
None => return Err(io::Error::new(io::ErrorKind::Other, "Error: path somehow contained a NUL?")),
|
||||
|
Loading…
Reference in New Issue
Block a user