Skip to content

Commit 54ed9e6

Browse files
committed
Merge pull request #31 from toqueteos/nightlies_4feb
Update to latest Rust.
2 parents a0e6160 + 713746b commit 54ed9e6

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2525
html_root_url = "http://doc.rust-lang.org/glob/")]
2626
#![cfg_attr(test, deny(warnings))]
27-
#![cfg_attr(test, feature(os))]
28-
#![feature(path, io, core, collections, hash, std_misc, unicode)]
27+
#![feature(path, io, core, collections, hash, std_misc, unicode, env)]
2928

3029
use std::ascii::AsciiExt;
3130
use std::cell::Cell;
32-
use std::{cmp, path};
31+
use std::cmp;
3332
use std::old_io::fs::{self, PathExtensions};
34-
use std::path::is_sep;
33+
use std::old_path as path;
34+
use std::old_path::is_sep;
3535
use std::string::String;
3636
use std::fmt;
3737
use std::old_io::IoError;
@@ -137,10 +137,10 @@ pub fn glob_with(pattern: &str, options: &MatchOptions) -> Result<Paths, Pattern
137137

138138
#[cfg(windows)]
139139
fn to_scope(p: Path) -> Path {
140-
use std::os::getcwd;
140+
use std::env::current_dir;
141141

142142
if path::windows::is_vol_relative(&p) {
143-
let mut cwd = getcwd().unwrap();
143+
let mut cwd = current_dir().unwrap();
144144
cwd.push(p);
145145
cwd
146146
} else {
@@ -861,7 +861,7 @@ impl MatchOptions {
861861

862862
#[cfg(test)]
863863
mod test {
864-
use std::os;
864+
use std::env;
865865
use super::{glob, Pattern, MatchOptions};
866866

867867
#[test]
@@ -918,7 +918,7 @@ mod test {
918918
assert!(glob("//").unwrap().next().is_some());
919919

920920
// check windows absolute paths with host/device components
921-
let root_with_device = os::getcwd().unwrap().root_path().unwrap().join("*");
921+
let root_with_device = env::current_dir().unwrap().root_path().unwrap().join("*");
922922
// FIXME (#9639): This needs to handle non-utf8 paths
923923
assert!(glob(root_with_device.as_str().unwrap()).unwrap().next().is_some());
924924
}

tests/glob-std.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
// except according to those terms.
1010

1111
// ignore-windows TempDir may cause IoError on windows: #10462
12-
#![feature(path, os, io)]
13-
14-
#![feature(path, os, io)]
12+
#![feature(path, env, io)]
1513

1614
extern crate glob;
1715

1816
use glob::glob;
19-
use std::os;
17+
use std::env;
2018
use std::old_io;
2119
use std::old_io::TempDir;
2220

@@ -42,7 +40,7 @@ fn main() {
4240

4341
let root = TempDir::new("glob-tests");
4442
let root = root.ok().expect("Should have created a temp directory");
45-
assert!(os::change_dir(root.path()).is_ok());
43+
assert!(env::set_current_dir(root.path()).is_ok());
4644

4745
mk_file("aaa", true);
4846
mk_file("aaa/apple", true);
@@ -55,7 +53,7 @@ fn main() {
5553
mk_file("bbb/specials/!", false);
5654

5755
// windows does not allow `*` or `?` characters to exist in filenames
58-
if os::consts::FAMILY != "windows" {
56+
if env::consts::FAMILY != "windows" {
5957
mk_file("bbb/specials/*", false);
6058
mk_file("bbb/specials/?", false);
6159
}
@@ -156,7 +154,7 @@ fn main() {
156154
assert_eq!(glob_vec("aaa/apple/nope"), Vec::new());
157155

158156
// windows should support both / and \ as directory separators
159-
if os::consts::FAMILY == "windows" {
157+
if env::consts::FAMILY == "windows" {
160158
assert_eq!(glob_vec("aaa\\apple"), vec!(Path::new("aaa/apple")));
161159
}
162160

@@ -228,12 +226,12 @@ fn main() {
228226
assert_eq!(glob_vec("bbb/specials/!"), vec!(Path::new("bbb/specials/!")));
229227
assert_eq!(glob_vec("bbb/specials/[]]"), vec!(Path::new("bbb/specials/]")));
230228

231-
if os::consts::FAMILY != "windows" {
229+
if env::consts::FAMILY != "windows" {
232230
assert_eq!(glob_vec("bbb/specials/[*]"), vec!(Path::new("bbb/specials/*")));
233231
assert_eq!(glob_vec("bbb/specials/[?]"), vec!(Path::new("bbb/specials/?")));
234232
}
235233

236-
if os::consts::FAMILY == "windows" {
234+
if env::consts::FAMILY == "windows" {
237235

238236
assert_eq!(glob_vec("bbb/specials/[![]"), vec!(
239237
Path::new("bbb/specials/!"),

0 commit comments

Comments
 (0)