Clippy fixes
This commit is contained in:
parent
12e1844e12
commit
f8028f2c5e
16
src/lib.rs
16
src/lib.rs
|
@ -54,7 +54,7 @@ fn demange_template_args(mut str: &str) -> Option<(&str, String)> {
|
||||||
fn demangle_class(str: &str) -> Option<(String, String, &str)> {
|
fn demangle_class(str: &str) -> Option<(String, String, &str)> {
|
||||||
let (size, rest) = parse_digits(str)?;
|
let (size, rest) = parse_digits(str)?;
|
||||||
// hack for template argument constants
|
// hack for template argument constants
|
||||||
if rest.is_empty() || rest.starts_with(",") {
|
if rest.is_empty() || rest.starts_with(',') {
|
||||||
let out = format!("{}", size);
|
let out = format!("{}", size);
|
||||||
return Some((out.clone(), out, rest));
|
return Some((out.clone(), out, rest));
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ fn demangle_qualified_class(mut str: &str) -> Option<(String, String, &str)> {
|
||||||
}
|
}
|
||||||
Some((last_class, qualified, str))
|
Some((last_class, qualified, str))
|
||||||
} else {
|
} else {
|
||||||
return demangle_class(str);
|
demangle_class(str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ fn demangle_arg(mut str: &str) -> Option<(String, &str)> {
|
||||||
is_member = true;
|
is_member = true;
|
||||||
let (_, member, rest) = demangle_qualified_class(&str[1..])?;
|
let (_, member, rest) = demangle_qualified_class(&str[1..])?;
|
||||||
post = format!("{}::*{}", member, post);
|
post = format!("{}::*{}", member, post);
|
||||||
if !rest.starts_with("F") {
|
if !rest.starts_with('F') {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
str = rest;
|
str = rest;
|
||||||
|
@ -114,7 +114,7 @@ fn demangle_arg(mut str: &str) -> Option<(String, &str)> {
|
||||||
str = &str[5..];
|
str = &str[5..];
|
||||||
}
|
}
|
||||||
let (args, rest) = demangle_function_args(str)?;
|
let (args, rest) = demangle_function_args(str)?;
|
||||||
if !rest.starts_with("_") {
|
if !rest.starts_with('_') {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let (ret, rest) = demangle_arg(&rest[1..])?;
|
let (ret, rest) = demangle_arg(&rest[1..])?;
|
||||||
|
@ -151,7 +151,7 @@ fn demangle_function_args(mut str: &str) -> Option<(String, &str)> {
|
||||||
let (arg, rest) = demangle_arg(str)?;
|
let (arg, rest) = demangle_arg(str)?;
|
||||||
result += arg.as_str();
|
result += arg.as_str();
|
||||||
str = rest;
|
str = rest;
|
||||||
if str.starts_with("_") || str.starts_with(",") {
|
if str.starts_with('_') || str.starts_with(',') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,17 +231,17 @@ pub fn demangle(mut str: &str) -> Option<String> {
|
||||||
if special {
|
if special {
|
||||||
fn_name = demangle_special_function(fn_name.as_str(), class_name.as_str())?;
|
fn_name = demangle_special_function(fn_name.as_str(), class_name.as_str())?;
|
||||||
}
|
}
|
||||||
if str.starts_with("C") {
|
if str.starts_with('C') {
|
||||||
str = &str[1..];
|
str = &str[1..];
|
||||||
cnst = true;
|
cnst = true;
|
||||||
}
|
}
|
||||||
if str.starts_with("F") {
|
if str.starts_with('F') {
|
||||||
str = &str[1..];
|
str = &str[1..];
|
||||||
let (args, rest) = demangle_function_args(str)?;
|
let (args, rest) = demangle_function_args(str)?;
|
||||||
fn_name = format!("{}({})", fn_name, args);
|
fn_name = format!("{}({})", fn_name, args);
|
||||||
str = rest;
|
str = rest;
|
||||||
}
|
}
|
||||||
if str.starts_with("_") {
|
if str.starts_with('_') {
|
||||||
str = &str[1..];
|
str = &str[1..];
|
||||||
let (ret, rest) = demangle_arg(str)?;
|
let (ret, rest) = demangle_arg(str)?;
|
||||||
qualified = format!("{} {}", ret, qualified);
|
qualified = format!("{} {}", ret, qualified);
|
||||||
|
|
Loading…
Reference in New Issue