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

Commit 05c275b

Browse files
authored
Merge pull request #34 from opilar/bugfix/refactor
Bugfix/refactor
2 parents 8c3ed02 + a06e054 commit 05c275b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl TempDir {
191191
let storage;
192192
let mut tmpdir = tmpdir.as_ref();
193193
if !tmpdir.is_absolute() {
194-
let cur_dir = try!(env::current_dir());
194+
let cur_dir = env::current_dir()?;
195195
storage = cur_dir.join(tmpdir);
196196
tmpdir = &storage;
197197
// return TempDir::new_in(&cur_dir.join(tmpdir), prefix);
@@ -200,7 +200,7 @@ impl TempDir {
200200
let mut rng = thread_rng();
201201
for _ in 0..NUM_RETRIES {
202202
let suffix: String = rng.gen_ascii_chars().take(NUM_RAND_CHARS).collect();
203-
let leaf = if prefix.len() > 0 {
203+
let leaf = if !prefix.is_empty() {
204204
format!("{}.{}", prefix, suffix)
205205
} else {
206206
// If we're given an empty string for a prefix, then creating a

0 commit comments

Comments
 (0)