Show More
@@ -29,6 +29,14 b' pub fn get_path_from_bytes(bytes: &[u8])' | |||
|
29 | 29 | Path::new(os_str) |
|
30 | 30 | } |
|
31 | 31 | |
|
32 | // TODO: need to convert from WTF8 to MBCS bytes on Windows. | |
|
33 | // that's why Vec<u8> is returned. | |
|
34 | #[cfg(unix)] | |
|
35 | pub fn get_bytes_from_path(path: impl AsRef<Path>) -> Vec<u8> { | |
|
36 | use std::os::unix::ffi::OsStrExt; | |
|
37 | path.as_ref().as_os_str().as_bytes().to_vec() | |
|
38 | } | |
|
39 | ||
|
32 | 40 | /// An iterator over repository path yielding itself and its ancestors. |
|
33 | 41 | #[derive(Copy, Clone, Debug)] |
|
34 | 42 | pub struct Ancestors<'a> { |
General Comments 0
You need to be logged in to leave comments.
Login now