libstd: Change Path::new to Path::init.

This commit is contained in:
Patrick Walton
2013-11-22 15:45:12 -08:00
parent 6c672ee094
commit c54427ddfb
40 changed files with 546 additions and 541 deletions

View File

@@ -140,13 +140,13 @@ pub fn main_args(args: &[~str]) -> int {
info!("going to format");
let started = time::precise_time_ns();
let output = matches.opt_str("o").map(|s| Path::new(s));
let output = matches.opt_str("o").map(|s| Path::init(s));
match matches.opt_str("w") {
Some(~"html") | None => {
html::render::run(crate, output.unwrap_or(Path::new("doc")))
html::render::run(crate, output.unwrap_or(Path::init("doc")))
}
Some(~"json") => {
json_output(crate, res, output.unwrap_or(Path::new("doc.json")))
json_output(crate, res, output.unwrap_or(Path::init("doc.json")))
}
Some(s) => {
println!("unknown output format: {}", s);
@@ -194,9 +194,9 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
let mut plugins = matches.opt_strs("plugins");
// First, parse the crate and extract all relevant information.
let libs = Cell::new(matches.opt_strs("L").map(|s| Path::new(s.as_slice())));
let libs = Cell::new(matches.opt_strs("L").map(|s| Path::init(s.as_slice())));
let cfgs = Cell::new(matches.opt_strs("cfg"));
let cr = Cell::new(Path::new(cratefile));
let cr = Cell::new(Path::init(cratefile));
info!("starting to run rustc");
let (crate, analysis) = do std::task::try {
let cr = cr.take();
@@ -238,7 +238,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
// Load all plugins/passes into a PluginManager
let path = matches.opt_str("plugin-path").unwrap_or(~"/tmp/rustdoc_ng/plugins");
let mut pm = plugins::PluginManager::new(Path::new(path));
let mut pm = plugins::PluginManager::new(Path::init(path));
for pass in passes.iter() {
let plugin = match PASSES.iter().position(|&(p, _, _)| p == *pass) {
Some(i) => PASSES[i].n1(),
@@ -262,7 +262,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
/// This input format purely deserializes the json output file. No passes are
/// run over the deserialized output.
fn json_input(input: &str) -> Result<Output, ~str> {
let input = match File::open(&Path::new(input)) {
let input = match File::open(&Path::init(input)) {
Some(f) => f,
None => return Err(format!("couldn't open {} for reading", input)),
};