Skip to content

Commit d5c25ef

Browse files
authored
Merge pull request #13 from lpenz/notempdir
Replace tempdir crate with tempfile
2 parents 75dd87f + 9e20c21 commit d5c25ef

File tree

5 files changed

+66
-38
lines changed

5 files changed

+66
-38
lines changed

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: rust
22
sudo: false
33
rust: stable
44
cache: cargo
5-
env:
6-
global: CARGO_VENDOR_VERSION=0.1.23
75
matrix:
86
include:
97
- env: TARGET=x86_64-unknown-linux-musl
@@ -17,9 +15,6 @@ matrix:
1715
# packages:
1816
# - gcc-arm-linux-gnueabihf
1917
install:
20-
- curl -sSfL https://github.com/alexcrichton/cargo-vendor/releases/download/${CARGO_VENDOR_VERSION}/cargo-vendor-${CARGO_VENDOR_VERSION}-x86_64-unknown-linux-musl.tar.gz
21-
| tar xzf - -C $HOME/bin --strip-components=1
22-
- cargo vendor --version
2318
- rustup target add $TARGET
2419
script:
2520
- if [[ $TARGET == "aarch64-unknown-linux-musl" ]]; then sudo apt-get install -y --force-yes --no-install-recommends gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross; fi

Cargo.lock

Lines changed: 61 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ edition = "2018"
66

77
[dependencies]
88
nix = "0.13.*"
9-
tempdir = "0.*"
9+
tempfile = "3"

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::path::Path;
1414
use std::path::PathBuf;
1515
use std::process;
1616
use std::string::String;
17-
use tempdir::TempDir;
17+
use tempfile::TempDir;
1818

1919
const NONE: Option<&'static [u8]> = None;
2020

@@ -235,7 +235,7 @@ fn main() {
235235
process::exit(1);
236236
}
237237
let tempdir =
238-
TempDir::new("nix").expect("failed to create temporary directory for mount point");
238+
TempDir::new().expect("failed to create temporary directory for mount point");
239239
let rootdir = PathBuf::from(tempdir.path());
240240

241241
let nixdir = fs::canonicalize(&args[1])

tests/integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use std::env;
22
use std::path::PathBuf;
33
use std::process::Command;
4-
use tempdir::TempDir;
4+
use tempfile::TempDir;
55

66
#[test]
77
fn run_nix_install() {
88
let root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
99
let cmd_path = root.join("target/debug/nix-user-chroot");
1010
assert!(cmd_path.exists());
1111

12-
let tempdir = TempDir::new("nix-install").unwrap();
12+
let tempdir = TempDir::new().unwrap();
1313

1414
let result = Command::new(cmd_path)
1515
.args(&[

0 commit comments

Comments
 (0)