diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2015-03-24 16:54:09 -0700 |
|---|---|---|
| committer | Tamir Duberstein <tamird@gmail.com> | 2015-04-14 20:26:03 -0700 |
| commit | 10f15e72e6c265eb43d34dba564d86dbf1c4fb99 (patch) | |
| tree | d7032704f432c471748b1259d03975fef6e80eb0 /src/compiletest | |
| parent | 29ac04402d53d358a1f6200bea45a301ff05b2d1 (diff) | |
| download | rust-10f15e72e6c265eb43d34dba564d86dbf1c4fb99.tar.gz rust-10f15e72e6c265eb43d34dba564d86dbf1c4fb99.zip | |
Negative case of `len()` -> `is_empty()`
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/compiletest.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index eeb1493d868..d014512666f 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -368,7 +368,7 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> { match full_version_line { Some(ref full_version_line) - if full_version_line.trim().len() > 0 => { + if !full_version_line.trim().is_empty() => { let full_version_line = full_version_line.trim(); // used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)" @@ -408,7 +408,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> { match full_version_line { Some(ref full_version_line) - if full_version_line.trim().len() > 0 => { + if !full_version_line.trim().is_empty() => { let full_version_line = full_version_line.trim(); for (pos, l) in full_version_line.char_indices() { @@ -426,7 +426,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> { let vers = full_version_line[pos + 5..].chars().take_while(|c| { c.is_digit(10) }).collect::<String>(); - if vers.len() > 0 { return Some(vers) } + if !vers.is_empty() { return Some(vers) } } println!("Could not extract LLDB version from line '{}'", full_version_line); |
