From 22b7eb38024afc38dbcfaa18796371b7d6b5b1d0 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 28 Jun 2013 14:36:33 -0700 Subject: Rename #[mutable] to #[no_freeze] --- src/libstd/cell.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index e1d2b246dd3..53ea11f2b05 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -22,7 +22,8 @@ A dynamic, mutable location. Similar to a mutable option type, but friendlier. */ -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] #[deriving(Clone, DeepClone, Eq)] #[allow(missing_doc)] pub struct Cell { -- cgit 1.4.1-3-g733a5 From b9cf6a33d2b5c0006f780c01bcaae4047551eb75 Mon Sep 17 00:00:00 2001 From: blake2-ppc Date: Fri, 28 Jun 2013 13:52:37 +0200 Subject: iterator: UnfoldrIterator::new should have function argument last To match Rust conventions and enable use of `do` etc, make sure the closure is the last argument to the `new` method. --- src/libstd/iterator.rs | 4 ++-- src/test/run-pass/unfoldr-cross-crate.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 78940143f4e..765bf3b36f2 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -983,7 +983,7 @@ impl<'self, A, St> UnfoldrIterator<'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>(f: &'a fn(&mut St) -> Option, initial_state: St) + pub fn new<'a>(initial_state: St, f: &'a fn(&mut St) -> Option) -> UnfoldrIterator<'a, A, St> { UnfoldrIterator { f: f, @@ -1174,7 +1174,7 @@ mod tests { } } - let mut it = UnfoldrIterator::new(count, 0); + let mut it = UnfoldrIterator::new(0, count); let mut i = 0; for it.advance |counted| { assert_eq!(counted, i); diff --git a/src/test/run-pass/unfoldr-cross-crate.rs b/src/test/run-pass/unfoldr-cross-crate.rs index 4e98543ae82..7fcae90a8d1 100644 --- a/src/test/run-pass/unfoldr-cross-crate.rs +++ b/src/test/run-pass/unfoldr-cross-crate.rs @@ -24,7 +24,7 @@ fn main() { } } - let mut it = UnfoldrIterator::new(count, 0); + let mut it = UnfoldrIterator::new(0, count); let mut i = 0; for it.advance |counted| { assert_eq!(counted, i); -- cgit 1.4.1-3-g733a5