Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit 489d0cd

Browse files
committed
Enable testing on stable
1 parent 3ce9bb6 commit 489d0cd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/smoke.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(path_ext)]
12-
1311
extern crate tempdir;
1412

1513
use std::env;
1614
use std::fs;
17-
use std::io::prelude::*;
1815
use std::path::Path;
1916
use std::sync::mpsc::channel;
2017
use std::thread;
@@ -25,6 +22,18 @@ macro_rules! t {
2522
($e:expr) => (match $e { Ok(n) => n, Err(e) => panic!("error: {}", e) })
2623
}
2724

25+
trait PathExt {
26+
fn exists(&self) -> bool;
27+
fn is_dir(&self) -> bool;
28+
}
29+
30+
impl PathExt for Path {
31+
fn exists(&self) -> bool { fs::metadata(self).is_ok() }
32+
fn is_dir(&self) -> bool {
33+
fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false)
34+
}
35+
}
36+
2837
fn test_tempdir() {
2938
let path = {
3039
let p = t!(TempDir::new_in(&Path::new("."), "foobar"));

0 commit comments

Comments
 (0)