##// END OF EJS Templates
rust-cross-platform: remove `unimplemented!` to get compile-time errors...
Raphaël Gomès -
r43525:60ee5842 default draft
parent child Browse files
Show More
@@ -21,12 +21,9 b' pub fn get_path_from_bytes(bytes: &[u8])'
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 }
@@ -258,11 +258,8 b' pub fn hg_path_to_os_string<P: AsRef<HgP'
258 use std::os::unix::ffi::OsStrExt;
258 use std::os::unix::ffi::OsStrExt;
259 os_str = std::ffi::OsStr::from_bytes(&hg_path.as_ref().as_bytes());
259 os_str = std::ffi::OsStr::from_bytes(&hg_path.as_ref().as_bytes());
260 }
260 }
261 #[cfg(windows)]
261 // TODO Handle other platforms
262 {
262 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding).
263 // TODO: convert from Windows MBCS (ANSI encoding) to WTF8.
264 unimplemented!();
265 }
266 Ok(os_str.to_os_string())
263 Ok(os_str.to_os_string())
267 }
264 }
268
265
@@ -281,11 +278,9 b' pub fn os_string_to_hg_path_buf<S: AsRef'
281 use std::os::unix::ffi::OsStrExt;
278 use std::os::unix::ffi::OsStrExt;
282 buf = HgPathBuf::from_bytes(&os_string.as_ref().as_bytes());
279 buf = HgPathBuf::from_bytes(&os_string.as_ref().as_bytes());
283 }
280 }
284 #[cfg(windows)]
281 // TODO Handle other platforms
285 {
282 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding).
286 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding).
283
287 unimplemented!();
288 }
289 buf.check_state()?;
284 buf.check_state()?;
290 Ok(buf)
285 Ok(buf)
291 }
286 }
@@ -300,11 +295,9 b' pub fn path_to_hg_path_buf<P: AsRef<Path'
300 use std::os::unix::ffi::OsStrExt;
295 use std::os::unix::ffi::OsStrExt;
301 buf = HgPathBuf::from_bytes(&os_str.as_bytes());
296 buf = HgPathBuf::from_bytes(&os_str.as_bytes());
302 }
297 }
303 #[cfg(windows)]
298 // TODO Handle other platforms
304 {
299 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding).
305 // TODO: convert from WTF8 to Windows MBCS (ANSI encoding).
300
306 unimplemented!();
307 }
308 buf.check_state()?;
301 buf.check_state()?;
309 Ok(buf)
302 Ok(buf)
310 }
303 }
General Comments 0
You need to be logged in to leave comments. Login now