Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/utils/files.rs @ 43250:98d996a138de
rust-cross-platform: remove `unimplemented!` to get compile-time errors
We should get a compile-time error that there is missing functionality for the
targeted platform instead of the program breaking at runtime.
Differential Revision: https://phab.mercurial-scm.org/D7107
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 16 Oct 2019 17:16:23 +0300 |
parents | 7a01778bc7b7 |
children | 99394e6c5d12 |
comparison
equal
deleted
inserted
replaced
43249:63d440bef72a | 43250:98d996a138de |
---|---|
19 #[cfg(unix)] | 19 #[cfg(unix)] |
20 { | 20 { |
21 use std::os::unix::ffi::OsStrExt; | 21 use std::os::unix::ffi::OsStrExt; |
22 os_str = std::ffi::OsStr::from_bytes(bytes); | 22 os_str = std::ffi::OsStr::from_bytes(bytes); |
23 } | 23 } |
24 #[cfg(windows)] | 24 // TODO Handle other platforms |
25 { | 25 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). |
26 // TODO: convert from Windows MBCS (ANSI encoding) to WTF8. | 26 // Perhaps, the return type would have to be Result<PathBuf>. |
27 // Perhaps, the return type would have to be Result<PathBuf>. | |
28 unimplemented!() | |
29 } | |
30 | 27 |
31 Path::new(os_str) | 28 Path::new(os_str) |
32 } | 29 } |
33 | 30 |
34 /// An iterator over repository path yielding itself and its ancestors. | 31 /// An iterator over repository path yielding itself and its ancestors. |