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

Commit a06e054

Browse files
committed
Clean compiler warning
``` warning: length comparison to zero --> src/lib.rs:203:27 | 203 | let leaf = if prefix.len() > 0 { | ^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!prefix.is_empty()` | = note: #[warn(len_zero)] on by default = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#len_zero ```
1 parent 07c7597 commit a06e054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)