diff options
| author | bors <bors@rust-lang.org> | 2014-01-23 19:56:35 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-23 19:56:35 -0800 |
| commit | bf9c25562da1c0e768309693617e54e998a953d1 (patch) | |
| tree | f078fbc7fb349c83179c29139da51ea3b7213e20 /src/libstd/path | |
| parent | 2b62371c205d408cf5a833d12dc937012047a506 (diff) | |
| parent | 292ed3e55c595505069a589e104e365779c27933 (diff) | |
| download | rust-bf9c25562da1c0e768309693617e54e998a953d1.tar.gz rust-bf9c25562da1c0e768309693617e54e998a953d1.zip | |
auto merge of #11686 : mankyKitty/rust/rename-invert-to-flip-issue-10632, r=alexcrichton
Renamed the ```invert()``` function in ```iter.rs``` to ```flip()```, from #10632 Also renamed the ```Invert<T>``` type to ```Flip<T>```. Some related code comments changed. Documentation that I could find has been updated, and all the instances I could locate where the function/type were called have been updated as well. This is my first contribution to Rust! Apologies in advance if I've snarfed the PR process, I'm not used to rebase. I initially had issues with the ```codegen``` section of the tests failing, however the ```make check``` process is not reporting any failures at this time. I think that was a local env issue more than me facerolling my changes. :)
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/windows.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 666b8977cc9..cc0705ee76f 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -17,7 +17,7 @@ use clone::Clone; use container::Container; use cmp::Eq; use from_str::FromStr; -use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Invert, Iterator, Map}; +use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Rev, Iterator, Map}; use option::{Option, Some, None}; use str; use str::{CharSplits, OwnedStr, Str, StrVector, StrSlice}; @@ -35,7 +35,7 @@ pub type StrComponents<'a> = Map<'a, &'a str, Option<&'a str>, /// /// Each component is yielded as Option<&str> for compatibility with PosixPath, but /// every component in WindowsPath is guaranteed to be Some. -pub type RevStrComponents<'a> = Invert<Map<'a, &'a str, Option<&'a str>, +pub type RevStrComponents<'a> = Rev<Map<'a, &'a str, Option<&'a str>, CharSplits<'a, char>>>; /// Iterator that yields successive components of a Path as &[u8] @@ -571,8 +571,8 @@ impl GenericPath for Path { fn ends_with_path(&self, child: &Path) -> bool { if !child.is_relative() { return false; } - let mut selfit = self.str_components().invert(); - let mut childit = child.str_components().invert(); + let mut selfit = self.str_components().rev(); + let mut childit = child.str_components().rev(); loop { match (selfit.next(), childit.next()) { (Some(a), Some(b)) => if a != b { return false; }, @@ -628,7 +628,7 @@ impl Path { /// Returns an iterator that yields each component of the path in reverse as an Option<&str> /// See str_components() for details. pub fn rev_str_components<'a>(&'a self) -> RevStrComponents<'a> { - self.str_components().invert() + self.str_components().rev() } /// Returns an iterator that yields each component of the path in turn as a &[u8]. |
