chore: Appease clippy

This commit is contained in:
relrelb 2021-12-08 21:45:58 +02:00 committed by relrelb
parent 7d5463f850
commit da4b5986b1
6 changed files with 7 additions and 9 deletions

View File

@ -679,12 +679,12 @@ pub fn get_text_format<'gc>(
let mut begin_index = args let mut begin_index = args
.get(0) .get(0)
.cloned() .cloned()
.unwrap_or_else(|| Value::Integer(-1)) .unwrap_or(Value::Integer(-1))
.coerce_to_i32(activation)?; .coerce_to_i32(activation)?;
let mut end_index = args let mut end_index = args
.get(1) .get(1)
.cloned() .cloned()
.unwrap_or_else(|| Value::Integer(-1)) .unwrap_or(Value::Integer(-1))
.coerce_to_i32(activation)?; .coerce_to_i32(activation)?;
if begin_index < 0 { if begin_index < 0 {

View File

@ -146,7 +146,7 @@ fn to_exponential<'gc>(
return Ok(AvmString::new_utf8( return Ok(AvmString::new_utf8(
activation.context.gc_context, activation.context.gc_context,
format!("{0:.1$e}", number, digits) format!("{0:.1$e}", number, digits)
.replace("e", "e+") .replace('e', "e+")
.replace("e+-", "e-") .replace("e+-", "e-")
.replace("e+0", ""), .replace("e+0", ""),
) )

View File

@ -160,7 +160,7 @@ fn to_exponential<'gc>(
return Ok(AvmString::new_utf8( return Ok(AvmString::new_utf8(
activation.context.gc_context, activation.context.gc_context,
format!("{0:.1$e}", number, digits) format!("{0:.1$e}", number, digits)
.replace("e", "e+") .replace('e', "e+")
.replace("e+-", "e-") .replace("e+-", "e-")
.replace("e+0", ""), .replace("e+0", ""),
) )

View File

@ -146,7 +146,7 @@ fn to_exponential<'gc>(
return Ok(AvmString::new_utf8( return Ok(AvmString::new_utf8(
activation.context.gc_context, activation.context.gc_context,
format!("{0:.1$e}", number, digits) format!("{0:.1$e}", number, digits)
.replace("e", "e+") .replace('e', "e+")
.replace("e+-", "e-") .replace("e+-", "e-")
.replace("e+0", ""), .replace("e+0", ""),
) )

View File

@ -281,8 +281,7 @@ impl PendingPath {
fn into_draw_commands(self) -> impl Iterator<Item = DrawCommand> { fn into_draw_commands(self) -> impl Iterator<Item = DrawCommand> {
self.segments self.segments
.into_iter() .into_iter()
.map(PathSegment::into_draw_commands) .flat_map(PathSegment::into_draw_commands)
.flatten()
} }
} }

View File

@ -264,8 +264,7 @@ impl fmt::Debug for SwfStr {
for chr in self for chr in self
.string .string
.iter() .iter()
.map(|&c| std::ascii::escape_default(c)) .flat_map(|&c| std::ascii::escape_default(c))
.flatten()
{ {
fmt::Write::write_char(f, char::from(chr))?; fmt::Write::write_char(f, char::from(chr))?;
} }