Changed most vec! invocations to use square braces

Most of the Rust community agrees that the vec! macro is clearer when
called using square brackets [] instead of regular brackets (). Most of
these ocurrences are from before macros allowed using different types of
brackets.

There is one left unchanged in a pretty-print test, as the pretty
printer still wants it to have regular brackets.
This commit is contained in:
iirelu 2016-10-29 22:54:04 +01:00
parent f26eedb571
commit e593c3b893
189 changed files with 511 additions and 511 deletions

View file

@ -143,8 +143,8 @@ pub fn run_core(search_paths: SearchPaths,
let sessopts = config::Options {
maybe_sysroot: maybe_sysroot,
search_paths: search_paths,
crate_types: vec!(config::CrateTypeRlib),
lint_opts: vec!((warning_lint, lint::Allow)),
crate_types: vec![config::CrateTypeRlib],
lint_opts: vec![(warning_lint, lint::Allow)],
lint_cap: Some(lint::Allow),
externs: externs,
target_triple: triple.unwrap_or(config::host_triple().to_string()),

View file

@ -644,7 +644,7 @@ mod tests {
t("test_harness", false, false, false, true, true, false, Vec::new());
t("compile_fail", false, true, false, true, false, true, Vec::new());
t("E0450", false, false, false, true, false, false,
vec!("E0450".to_owned()));
vec!["E0450".to_owned()]);
t("{.no_run .example}", false, true, false, true, false, false, Vec::new());
t("{.sh .should_panic}", true, false, false, true, false, false, Vec::new());
t("{.example .rust}", false, false, false, true, false, false, Vec::new());

View file

@ -1260,7 +1260,7 @@ impl Context {
item.name = Some(krate.name);
// render the crate documentation
let mut work = vec!((self, item));
let mut work = vec![(self, item)];
while let Some((mut cx, item)) = work.pop() {
cx.item(item, |cx, item| {

View file

@ -247,7 +247,7 @@ mod tests {
macro_rules! toc {
($(($level: expr, $name: expr, $(($sub: tt))* )),*) => {
Toc {
entries: vec!(
entries: vec![
$(
TocEntry {
level: $level,
@ -257,7 +257,7 @@ mod tests {
children: toc!($($sub),*)
}
),*
)
]
}
}
}

View file

@ -111,7 +111,7 @@ fn unstable(g: getopts::OptGroup) -> RustcOptGroup { RustcOptGroup::unstable(g)
pub fn opts() -> Vec<RustcOptGroup> {
use getopts::*;
vec!(
vec![
stable(optflag("h", "help", "show this help message")),
stable(optflag("V", "version", "print rustdoc's version")),
stable(optflag("v", "verbose", "use verbose output")),
@ -162,7 +162,7 @@ pub fn opts() -> Vec<RustcOptGroup> {
unstable(optmulti("Z", "",
"internal and debugging options (only on nightly build)", "FLAG")),
stable(optopt("", "sysroot", "Override the system root", "PATH")),
)
]
}
pub fn usage(argv0: &str) {

View file

@ -66,7 +66,7 @@ pub fn run(input: &str,
maybe_sysroot: Some(env::current_exe().unwrap().parent().unwrap()
.parent().unwrap().to_path_buf()),
search_paths: libs.clone(),
crate_types: vec!(config::CrateTypeDylib),
crate_types: vec![config::CrateTypeDylib],
externs: externs.clone(),
unstable_features: UnstableFeatures::from_environment(),
..config::basic_options().clone()
@ -185,7 +185,7 @@ fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
maybe_sysroot: Some(env::current_exe().unwrap().parent().unwrap()
.parent().unwrap().to_path_buf()),
search_paths: libs,
crate_types: vec!(config::CrateTypeExecutable),
crate_types: vec![config::CrateTypeExecutable],
output_types: outputs,
externs: externs,
cg: config::CodegenOptions {