about summary refs log tree commit diff
path: root/src/libstd/iterator.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-09-07 18:10:59 -0700
committerbors <bors@rust-lang.org>2013-09-07 18:10:59 -0700
commit5591dce52eb35730e89070c7e104e1f1bf0a8ab3 (patch)
treee56f60b1fa35b3f157b21a1879dbb03080d8f4e2 /src/libstd/iterator.rs
parentb3d50fc2c015cc8a335855b82ab458a15a7413d9 (diff)
parent4c2b480aae2abb87e617076ee3f672f5c851d7d0 (diff)
downloadrust-5591dce52eb35730e89070c7e104e1f1bf0a8ab3.tar.gz
rust-5591dce52eb35730e89070c7e104e1f1bf0a8ab3.zip
auto merge of #9050 : huonw/rust/unfoldnor, r=thestinger
The `r` is not relevant, since there is only one direction of folding
(unlike Haskell).
Diffstat (limited to 'src/libstd/iterator.rs')
-rw-r--r--src/libstd/iterator.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs
index db67a624a9b..77637b6998e 100644
--- a/src/libstd/iterator.rs
+++ b/src/libstd/iterator.rs
@@ -1672,26 +1672,26 @@ for Inspect<'self, A, T> {
 }
 
 /// An iterator which just modifies the contained state throughout iteration.
-pub struct Unfoldr<'self, A, St> {
+pub struct Unfold<'self, A, St> {
     priv f: &'self fn(&mut St) -> Option<A>,
     /// Internal state that will be yielded on the next iteration
     state: St
 }
 
-impl<'self, A, St> Unfoldr<'self, A, St> {
+impl<'self, A, St> Unfold<'self, A, St> {
     /// Creates a new iterator with the specified closure as the "iterator
     /// function" and an initial state to eventually pass to the iterator
     #[inline]
     pub fn new<'a>(initial_state: St, f: &'a fn(&mut St) -> Option<A>)
-        -> Unfoldr<'a, A, St> {
-        Unfoldr {
+        -> Unfold<'a, A, St> {
+        Unfold {
             f: f,
             state: initial_state
         }
     }
 }
 
-impl<'self, A, St> Iterator<A> for Unfoldr<'self, A, St> {
+impl<'self, A, St> Iterator<A> for Unfold<'self, A, St> {
     #[inline]
     fn next(&mut self) -> Option<A> {
         (self.f)(&mut self.state)
@@ -2213,7 +2213,7 @@ mod tests {
             }
         }
 
-        let mut it = Unfoldr::new(0, count);
+        let mut it = Unfold::new(0, count);
         let mut i = 0;
         for counted in it {
             assert_eq!(counted, i);