# HG changeset patch # User Raphaël Gomès # Date 2019-10-16 14:16:23 # Node ID 60ee5842f1817995576cb3d70193929f9d8737a4 # Parent 3239f8b76bbf4b6481435eadc2ed76eaa05d368f 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 diff --git a/rust/hg-core/src/utils/files.rs b/rust/hg-core/src/utils/files.rs --- a/rust/hg-core/src/utils/files.rs +++ b/rust/hg-core/src/utils/files.rs @@ -21,12 +21,9 @@ pub fn get_path_from_bytes(bytes: &[u8]) 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. - unimplemented!() - } + // TODO Handle other platforms + // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). + // Perhaps, the return type would have to be Result. Path::new(os_str) } diff --git a/rust/hg-core/src/utils/hg_path.rs b/rust/hg-core/src/utils/hg_path.rs --- a/rust/hg-core/src/utils/hg_path.rs +++ b/rust/hg-core/src/utils/hg_path.rs @@ -258,11 +258,8 @@ pub fn hg_path_to_os_string