From b3aa1a6d4ac88f68e036a05fdf19be63b522b65d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Jul 2015 08:33:13 -0700 Subject: std: Deprecate a number of unstable features Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset --- src/libstd/path.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstd/path.rs') diff --git a/src/libstd/path.rs b/src/libstd/path.rs index d3573345afb..f5f8508e9aa 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -200,7 +200,7 @@ mod platform { return Some(VerbatimUNC(server, share)); } else { // \\?\path - let idx = path.position_elem(&b'\\'); + let idx = path.iter().position(|&b| b == b'\\'); if idx == Some(2) && path[1] == b':' { let c = path[0]; if c.is_ascii() && (c as char).is_alphabetic() { @@ -214,7 +214,8 @@ mod platform { } else if path.starts_with(b".\\") { // \\.\path path = &path[2..]; - let slice = &path[.. path.position_elem(&b'\\').unwrap_or(path.len())]; + let pos = path.iter().position(|&b| b == b'\\'); + let slice = &path[..pos.unwrap_or(path.len())]; return Some(DeviceNS(u8_slice_as_os_str(slice))); } match parse_two_comps(path, is_sep_byte) { -- cgit 1.4.1-3-g733a5