Fix build (obsolete tilde)

~[int] is now obsoleted
also sync::Future is now in std::sync::Future

should fix the build

Actually I think you're totally right, as even my concern about "allocating an empty vector on the heap" is baseless.

Per the docs, Vec allocates only when you start pushing elements on it (http://doc.rust-lang.org/std/vec/struct.Vec.html#method.new).
So, yes in Real code the only way I can think about where you might end up with a &[] is by creating a Vec and then taking a slice out of it before having added any element to it, just as you said...

-----Original Message-----
From: "Adolfo Ochagavía" <notifications@github.com>
Sent: ‎13/‎06/‎2014 10.44
To: "Hoverbear/rust-rosetta" <rust-rosetta@noreply.github.com>
Cc: "Paolo Falabella" <paolo.falabella@gmail.com>
Subject: Re: [rust-rosetta] Fix build (obsolete tilde) (#148)

In src/bubble_sort.rs:
> @@ -38,7 +38,7 @@ fn test_rosetta_vector() {
>  
>  #[test]
>  fn test_empty_vector() {
> -    let mut numbers: ~[int] = ~[];
> +    let numbers: &mut[int] = &mut[];
>      bubble_sort(numbers);
>      check_sort(numbers);
I think in this case it would be better to use a vec![] and the as_mut_slice() method to be more consistent with real-world code (usually you don't see something like &mut[] and I guess this can be strange for beginners). However, this is a matter of taste, so if you disagree I will merge it anyway.
—
Reply to this email directly or view it on GitHub.