diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-22 15:45:12 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-29 10:55:13 -0800 |
| commit | c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b (patch) | |
| tree | 7b4e7af9dfe4342f3fd474f1010d4839281edd87 /src/librustdoc | |
| parent | 6c672ee094a1a8e72c100100f43c73a9741f08a7 (diff) | |
| download | rust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.tar.gz rust-c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.zip | |
libstd: Change `Path::new` to `Path::init`.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/html/render.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 0df4820d822..3dc4b052f1c 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -336,7 +336,7 @@ fn mkdir(path: &Path) { /// static HTML tree. // FIXME (#9639): The closure should deal with &[u8] instead of &str fn clean_srcpath(src: &[u8], f: |&str|) { - let p = Path::new(src); + let p = Path::init(src); if p.as_vec() != bytes!(".") { for c in p.str_components().map(|x|x.unwrap()) { if ".." == c { @@ -411,7 +411,7 @@ impl<'self> DocFolder for SourceCollector<'self> { impl<'self> SourceCollector<'self> { /// Renders the given filename into its corresponding HTML source file. fn emit_source(&mut self, filename: &str) -> bool { - let p = Path::new(filename); + let p = Path::init(filename); // Read the contents of the file let mut contents = ~[]; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index c5b2125c163..c51244cddf5 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -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)), }; |
