libstd: Change Path::new to Path::init.
This commit is contained in:
parent
6c672ee094
commit
c54427ddfb
40 changed files with 546 additions and 541 deletions
|
|
@ -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 = ~[];
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue