Remove kludgy imports from vec! macro
This commit is contained in:
parent
9db1d35687
commit
054b1ff989
11 changed files with 14 additions and 28 deletions
|
|
@ -1574,7 +1574,7 @@ mod tests {
|
|||
use std::rand::Rng;
|
||||
use test::Bencher;
|
||||
|
||||
use {Set, Mutable, MutableSet};
|
||||
use {Set, Mutable, MutableSet, MutableSeq};
|
||||
use bitv::{Bitv, BitvSet, from_fn, from_bytes};
|
||||
use bitv;
|
||||
use vec::Vec;
|
||||
|
|
|
|||
|
|
@ -782,6 +782,8 @@ mod test_btree {
|
|||
|
||||
use super::{BTree, Node, LeafElt};
|
||||
|
||||
use MutableSeq;
|
||||
|
||||
//Tests the functionality of the insert methods (which are unfinished).
|
||||
#[test]
|
||||
fn insert_test_one() {
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ mod test {
|
|||
|
||||
use enum_set::{EnumSet, CLike};
|
||||
|
||||
use MutableSeq;
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[repr(uint)]
|
||||
enum Foo {
|
||||
|
|
|
|||
|
|
@ -11,26 +11,8 @@
|
|||
#![macro_escape]
|
||||
|
||||
/// Create a `std::vec::Vec` containing the arguments.
|
||||
#[cfg(not(test))]
|
||||
macro_rules! vec(
|
||||
($($e:expr),*) => ({
|
||||
#[allow(unused_imports)]
|
||||
use std::collections::MutableSeq;
|
||||
|
||||
// leading _ to allow empty construction without a warning.
|
||||
let mut _temp = ::vec::Vec::new();
|
||||
$(_temp.push($e);)*
|
||||
_temp
|
||||
});
|
||||
($($e:expr),+,) => (vec!($($e),+))
|
||||
)
|
||||
|
||||
#[cfg(test)]
|
||||
macro_rules! vec(
|
||||
($($e:expr),*) => ({
|
||||
#[allow(unused_imports)]
|
||||
use MutableSeq;
|
||||
|
||||
// leading _ to allow empty construction without a warning.
|
||||
let mut _temp = ::vec::Vec::new();
|
||||
$(_temp.push($e);)*
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ mod tests {
|
|||
use test::Bencher;
|
||||
use test;
|
||||
|
||||
use {Deque, Mutable};
|
||||
use {Deque, Mutable, MutableSeq};
|
||||
use super::RingBuf;
|
||||
use vec::Vec;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use core::fmt;
|
|||
use core::iter::{Enumerate, FilterMap};
|
||||
use core::mem::replace;
|
||||
|
||||
use {Collection, Mutable, Map, MutableMap};
|
||||
use {Collection, Mutable, Map, MutableMap, MutableSeq};
|
||||
use {vec, slice};
|
||||
use vec::Vec;
|
||||
|
||||
|
|
|
|||
|
|
@ -562,6 +562,8 @@ pub mod raw {
|
|||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
use MutableSeq;
|
||||
|
||||
pub use core::str::raw::{from_utf8, c_str_to_static_slice, slice_bytes};
|
||||
pub use core::str::raw::{slice_unchecked};
|
||||
|
||||
|
|
@ -818,7 +820,7 @@ mod tests {
|
|||
use std::option::{Some, None};
|
||||
use std::ptr::RawPtr;
|
||||
use std::iter::{Iterator, DoubleEndedIterator};
|
||||
use Collection;
|
||||
use {Collection, MutableSeq};
|
||||
|
||||
use super::*;
|
||||
use std::slice::{Vector, ImmutableVector};
|
||||
|
|
|
|||
|
|
@ -1659,7 +1659,7 @@ mod test_set {
|
|||
use std::prelude::*;
|
||||
use std::hash;
|
||||
|
||||
use {Set, MutableSet, Mutable, MutableMap};
|
||||
use {Set, MutableSet, Mutable, MutableMap, MutableSeq};
|
||||
use super::{TreeMap, TreeSet};
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ mod test_map {
|
|||
use std::uint;
|
||||
use std::hash;
|
||||
|
||||
use {MutableMap, Map};
|
||||
use {MutableMap, Map, MutableSeq};
|
||||
use super::{TrieMap, TrieNode, Internal, External, Nothing};
|
||||
|
||||
fn check_integrity<T>(trie: &TrieNode<T>) {
|
||||
|
|
@ -1105,7 +1105,7 @@ mod test_set {
|
|||
use std::prelude::*;
|
||||
use std::uint;
|
||||
|
||||
use {MutableSet, Set};
|
||||
use {MutableSet, Set, MutableSeq};
|
||||
use super::TrieSet;
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
//! listener (socket server) implements the `Listener` and `Acceptor` traits.
|
||||
|
||||
use clone::Clone;
|
||||
use collections::MutableSeq;
|
||||
use io::IoResult;
|
||||
use iter::Iterator;
|
||||
use slice::ImmutableVector;
|
||||
|
|
|
|||
|
|
@ -315,9 +315,6 @@ macro_rules! try(
|
|||
#[macro_export]
|
||||
macro_rules! vec(
|
||||
($($e:expr),*) => ({
|
||||
#[allow(unused_imports)]
|
||||
use std::collections::MutableSeq;
|
||||
|
||||
// leading _ to allow empty construction without a warning.
|
||||
let mut _temp = ::std::vec::Vec::new();
|
||||
$(_temp.push($e);)*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue