##// END OF EJS Templates
rust-filepatterns: silence warning of non_upper_case_globals
rust-filepatterns: silence warning of non_upper_case_globals

File last commit:

r42630:9609430d default
r42683:a4a468b0 default
Show More
files.rs
17 lines | 371 B | application/rls-services+xml | RustLexer
Raphaël Gomès
rust-filepatterns: use bytes instead of String...
r42630 use std::path::Path;
pub fn get_path_from_bytes(bytes: &[u8]) -> &Path {
let os_str;
#[cfg(unix)]
{
use std::os::unix::ffi::OsStrExt;
os_str = std::ffi::OsStr::from_bytes(bytes);
}
#[cfg(windows)]
{
use std::os::windows::ffi::OsStrExt;
os_str = std::ffi::OsString::from_wide(bytes);
}
Path::new(os_str)
}