address tidy error & comment

This commit is contained in:
Andre Bogus 2017-06-27 07:16:54 +02:00
parent 3d25238d6d
commit 1715559f82
2 changed files with 3 additions and 4 deletions

View File

@ -549,9 +549,7 @@ impl Config {
pub fn lldb_version_to_int(version_string: &str) -> isize {
let error_string = format!("Encountered LLDB version string with unexpected format: {}",
version_string);
let error_string = error_string;
let major: isize = version_string.parse().expect(&error_string);
major
version_string.parse().expect(&error_string);
}
fn expand_variables(mut value: String, config: &Config) -> String {

View File

@ -598,7 +598,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
Some(idx) => if line.as_bytes()[idx] == b'.' {
let patch = &line[idx + 1..];
let patch_len = patch.find(|c: char| !c.is_digit(10)).unwrap_or_else(|| patch.len());
let patch_len = patch.find(|c: char| !c.is_digit(10))
.unwrap_or_else(|| patch.len());
let patch = &patch[..patch_len];
let patch = if patch_len > 3 || patch_len == 0 { None } else { Some(patch) };