chore: clippy fix rust style
This commit is contained in:
parent
8d91e7eb63
commit
a0c07631e2
@ -102,8 +102,8 @@ fn map_std_type_name(name: &str, shorthands: bool) -> &str {
|
||||
};
|
||||
}
|
||||
|
||||
if name.starts_with("rhai::") {
|
||||
map_std_type_name(&name[6..], shorthands)
|
||||
if let Some(stripped) = name.strip_prefix("rhai::") {
|
||||
map_std_type_name(stripped, shorthands)
|
||||
} else {
|
||||
name
|
||||
}
|
||||
|
@ -793,11 +793,8 @@ impl AST {
|
||||
|| !options.contains(ASTFlags::CONSTANT) && include_variables =>
|
||||
{
|
||||
let (name, expr, ..) = &**x;
|
||||
if let Some(value) = expr.get_literal_value() {
|
||||
Some((name.as_str(), options.contains(ASTFlags::CONSTANT), value))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
expr.get_literal_value()
|
||||
.map(|value| (name.as_str(), options.contains(ASTFlags::CONSTANT), value))
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
|
@ -486,8 +486,7 @@ impl<'a> IntoIterator for &'a StmtBlock {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
let x = self.block.iter();
|
||||
x
|
||||
self.block.iter()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -518,6 +518,6 @@ impl Engine {
|
||||
#[cfg(feature = "debugging")]
|
||||
global.debugger.reset_status(reset_debugger);
|
||||
|
||||
return result;
|
||||
result
|
||||
}
|
||||
}
|
||||
|
@ -1045,6 +1045,6 @@ impl Engine {
|
||||
#[cfg(feature = "debugging")]
|
||||
global.debugger.reset_status(reset_debugger);
|
||||
|
||||
return result;
|
||||
result
|
||||
}
|
||||
}
|
||||
|
@ -81,9 +81,9 @@ impl fmt::Display for Scope<'_> {
|
||||
#[cfg(feature = "no_closure")]
|
||||
let value_is_shared = "";
|
||||
|
||||
write!(
|
||||
writeln!(
|
||||
f,
|
||||
"[{}] {}{}{} = {:?}\n",
|
||||
"[{}] {}{}{} = {:?}",
|
||||
i + 1,
|
||||
if constant { "const " } else { "" },
|
||||
name,
|
||||
|
Loading…
Reference in New Issue
Block a user