diff --git a/core/src/avm2/globals/flash/text/textfield.rs b/core/src/avm2/globals/flash/text/textfield.rs index 7cb5ed0f6..5b1cfb43e 100644 --- a/core/src/avm2/globals/flash/text/textfield.rs +++ b/core/src/avm2/globals/flash/text/textfield.rs @@ -679,12 +679,12 @@ pub fn get_text_format<'gc>( let mut begin_index = args .get(0) .cloned() - .unwrap_or_else(|| Value::Integer(-1)) + .unwrap_or(Value::Integer(-1)) .coerce_to_i32(activation)?; let mut end_index = args .get(1) .cloned() - .unwrap_or_else(|| Value::Integer(-1)) + .unwrap_or(Value::Integer(-1)) .coerce_to_i32(activation)?; if begin_index < 0 { diff --git a/core/src/avm2/globals/int.rs b/core/src/avm2/globals/int.rs index 8391b4bf7..7cf86d583 100644 --- a/core/src/avm2/globals/int.rs +++ b/core/src/avm2/globals/int.rs @@ -146,7 +146,7 @@ fn to_exponential<'gc>( return Ok(AvmString::new_utf8( activation.context.gc_context, format!("{0:.1$e}", number, digits) - .replace("e", "e+") + .replace('e', "e+") .replace("e+-", "e-") .replace("e+0", ""), ) diff --git a/core/src/avm2/globals/number.rs b/core/src/avm2/globals/number.rs index c7d87adb3..8b7d7d6d5 100644 --- a/core/src/avm2/globals/number.rs +++ b/core/src/avm2/globals/number.rs @@ -160,7 +160,7 @@ fn to_exponential<'gc>( return Ok(AvmString::new_utf8( activation.context.gc_context, format!("{0:.1$e}", number, digits) - .replace("e", "e+") + .replace('e', "e+") .replace("e+-", "e-") .replace("e+0", ""), ) diff --git a/core/src/avm2/globals/uint.rs b/core/src/avm2/globals/uint.rs index f6687d1c1..596ee20f4 100644 --- a/core/src/avm2/globals/uint.rs +++ b/core/src/avm2/globals/uint.rs @@ -146,7 +146,7 @@ fn to_exponential<'gc>( return Ok(AvmString::new_utf8( activation.context.gc_context, format!("{0:.1$e}", number, digits) - .replace("e", "e+") + .replace('e', "e+") .replace("e+-", "e-") .replace("e+0", ""), ) diff --git a/core/src/shape_utils.rs b/core/src/shape_utils.rs index 6d0bc668f..f7f1eba2c 100644 --- a/core/src/shape_utils.rs +++ b/core/src/shape_utils.rs @@ -281,8 +281,7 @@ impl PendingPath { fn into_draw_commands(self) -> impl Iterator { self.segments .into_iter() - .map(PathSegment::into_draw_commands) - .flatten() + .flat_map(PathSegment::into_draw_commands) } } diff --git a/swf/src/string.rs b/swf/src/string.rs index b65d43d77..d9f12a885 100644 --- a/swf/src/string.rs +++ b/swf/src/string.rs @@ -264,8 +264,7 @@ impl fmt::Debug for SwfStr { for chr in self .string .iter() - .map(|&c| std::ascii::escape_default(c)) - .flatten() + .flat_map(|&c| std::ascii::escape_default(c)) { fmt::Write::write_char(f, char::from(chr))?; }