提交 45ddf50c 编写于 作者: A Aaron Turon

Add new path module

Implements [RFC 474](https://github.com/rust-lang/rfcs/pull/474); see
that RFC for details/motivation for this change.

This initial commit does not include additional normalization or
platform-specific path extensions. These will be done in follow up
commits or PRs.
上级 3e39f0bc
......@@ -24,6 +24,7 @@
mod c_str;
mod os_str;
// FIXME (#21670): these should be defined in the os_str module
/// Freely convertible to an `&OsStr` slice.
pub trait AsOsStr {
/// Convert to an `&OsStr` slice.
......
......@@ -41,7 +41,7 @@
use ops;
use cmp;
use hash::{Hash, Hasher, Writer};
use path::{Path, GenericPath};
use old_path::{Path, GenericPath};
use sys::os_str::{Buf, Slice};
use sys_common::{AsInner, IntoInner, FromInner};
......
此差异已折叠。
......@@ -20,7 +20,7 @@
use string::{String, CowString};
use mem;
#[derive(Clone)]
#[derive(Clone, Hash)]
pub struct Buf {
pub inner: Vec<u8>
}
......
......@@ -18,7 +18,7 @@
use option::Option;
use mem;
#[derive(Clone)]
#[derive(Clone, Hash)]
pub struct Buf {
pub inner: Wtf8Buf
}
......
......@@ -11,7 +11,7 @@
use std::slice::SliceExt;
use std::old_io::{Command, fs, USER_RWX};
use std::os;
use std::path::BytesContainer;
use std::old_path::BytesContainer;
use std::rand::random;
fn main() {
......
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
......@@ -15,8 +14,8 @@
#![feature(box_syntax)]
#![feature(unboxed_closures)]
use std::path::{Path};
use std::path;
use std::old_path::{Path};
use std::old_path;
use std::result;
use std::thunk::Thunk;
......@@ -28,7 +27,7 @@ fn tester()
result::Result::Ok("more blah".to_string())
};
let path = path::Path::new("blah");
let path = old_path::Path::new("blah");
assert!(loader(&path).is_ok());
}
......
......@@ -20,7 +20,7 @@
use std::old_io::fs;
use std::old_io::Command;
use std::os;
use std::path::Path;
use std::old_path::Path;
fn main() {
let my_args = os::args();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册