Mercurial > hg
diff 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 |
line wrap: on
line diff
--- a/rust/hg-core/src/utils/files.rs Fri Oct 11 00:18:34 2019 -0700 +++ b/rust/hg-core/src/utils/files.rs Wed Oct 16 17:16:23 2019 +0300 @@ -21,12 +21,9 @@ use std::os::unix::ffi::OsStrExt; os_str = std::ffi::OsStr::from_bytes(bytes); } - #[cfg(windows)] - { - // TODO: convert from Windows MBCS (ANSI encoding) to WTF8. - // Perhaps, the return type would have to be Result<PathBuf>. - unimplemented!() - } + // TODO Handle other platforms + // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). + // Perhaps, the return type would have to be Result<PathBuf>. Path::new(os_str) }