diff --git a/src/ast/expr.rs b/src/ast/expr.rs index e50e5086..3ec16433 100644 --- a/src/ast/expr.rs +++ b/src/ast/expr.rs @@ -286,7 +286,7 @@ impl FromStr for FloatWrapper { #[inline] fn from_str(s: &str) -> Result { - F::from_str(s).map(Into::::into) + F::from_str(s).map(Into::into) } } diff --git a/src/custom_syntax.rs b/src/custom_syntax.rs index 95ec521a..2cc109c6 100644 --- a/src/custom_syntax.rs +++ b/src/custom_syntax.rs @@ -211,9 +211,9 @@ impl Engine { /// Replacing one variable with another (i.e. adding a new variable and removing one variable at /// the same time so that the total _size_ of the [`Scope`][crate::Scope] is unchanged) also /// does NOT count, so `false` should be passed. - pub fn register_custom_syntax + Into>( + pub fn register_custom_syntax( &mut self, - symbols: &[S], + symbols: &[impl AsRef + Into], scope_may_be_changed: bool, func: impl Fn(&mut EvalContext, &[Expression]) -> RhaiResult + SendSync + 'static, ) -> ParseResult<&mut Self> { diff --git a/src/func/builtin.rs b/src/func/builtin.rs index 3375f243..e1320e3d 100644 --- a/src/func/builtin.rs +++ b/src/func/builtin.rs @@ -89,7 +89,7 @@ pub fn get_builtin_binary_op_fn(op: &str, x: &Dynamic, y: &Dynamic) -> Option $func:ident ( $xx:ident, $yy:ident )) => { |_, args| { let x = args[0].$xx().expect(BUILTIN) as $base; let y = args[1].$yy().expect(BUILTIN) as $base; - $func(x, y).map(Into::::into) + $func(x, y).map(Into::into) } }; (from $base:ty => $xx:ident $op:tt $yy:ident) => { |_, args| { let x = <$base>::from(args[0].$xx().expect(BUILTIN)); @@ -104,7 +104,7 @@ pub fn get_builtin_binary_op_fn(op: &str, x: &Dynamic, y: &Dynamic) -> Option $func:ident ( $xx:ident, $yy:ident )) => { |_, args| { let x = <$base>::from(args[0].$xx().expect(BUILTIN)); let y = <$base>::from(args[1].$yy().expect(BUILTIN)); - $func(x, y).map(Into::::into) + $func(x, y).map(Into::into) } }; } diff --git a/src/func/call.rs b/src/func/call.rs index 3090a35b..90f27913 100644 --- a/src/func/call.rs +++ b/src/func/call.rs @@ -967,7 +967,7 @@ impl Engine { .into_immutable_string() .map_err(|typ| self.make_type_mismatch_err::(typ, arg_pos)) .and_then(FnPtr::try_from) - .map(Into::::into) + .map(Into::into) .map_err(|err| err.fill_position(arg_pos)); } diff --git a/src/packages/fn_basic.rs b/src/packages/fn_basic.rs index fa6f33f2..6037761f 100644 --- a/src/packages/fn_basic.rs +++ b/src/packages/fn_basic.rs @@ -71,7 +71,7 @@ fn collect_fn_metadata(ctx: NativeCallContext) -> crate::Array { f.params .iter() .cloned() - .map(Into::::into) + .map(Into::into) .collect::() .into(), ); diff --git a/src/packages/map_basic.rs b/src/packages/map_basic.rs index a1f2fa5d..525ce5c0 100644 --- a/src/packages/map_basic.rs +++ b/src/packages/map_basic.rs @@ -102,7 +102,7 @@ mod map_functions { if map.is_empty() { Array::new() } else { - map.keys().cloned().map(Into::::into).collect() + map.keys().cloned().map(Into::into).collect() } } #[cfg(not(feature = "no_index"))] diff --git a/src/packages/string_more.rs b/src/packages/string_more.rs index dfaf047c..7ec7af76 100644 --- a/src/packages/string_more.rs +++ b/src/packages/string_more.rs @@ -599,7 +599,7 @@ mod string_functions { if string.is_empty() { Array::new() } else { - string.chars().map(Into::::into).collect() + string.chars().map(Into::into).collect() } } #[rhai_fn(name = "split")] @@ -624,57 +624,39 @@ mod string_functions { } } pub fn split(string: &str, delimiter: &str) -> Array { - string.split(delimiter).map(Into::::into).collect() + string.split(delimiter).map(Into::into).collect() } #[rhai_fn(name = "split")] pub fn splitn(string: &str, delimiter: &str, segments: INT) -> Array { let pieces: usize = if segments < 1 { 1 } else { segments as usize }; - string - .splitn(pieces, delimiter) - .map(Into::::into) - .collect() + string.splitn(pieces, delimiter).map(Into::into).collect() } #[rhai_fn(name = "split")] pub fn split_char(string: &str, delimiter: char) -> Array { - string.split(delimiter).map(Into::::into).collect() + string.split(delimiter).map(Into::into).collect() } #[rhai_fn(name = "split")] pub fn splitn_char(string: &str, delimiter: char, segments: INT) -> Array { let pieces: usize = if segments < 1 { 1 } else { segments as usize }; - string - .splitn(pieces, delimiter) - .map(Into::::into) - .collect() + string.splitn(pieces, delimiter).map(Into::into).collect() } #[rhai_fn(name = "split_rev")] pub fn rsplit(string: &str, delimiter: &str) -> Array { - string - .rsplit(delimiter) - .map(Into::::into) - .collect() + string.rsplit(delimiter).map(Into::into).collect() } #[rhai_fn(name = "split_rev")] pub fn rsplitn(string: &str, delimiter: &str, segments: INT) -> Array { let pieces: usize = if segments < 1 { 1 } else { segments as usize }; - string - .rsplitn(pieces, delimiter) - .map(Into::::into) - .collect() + string.rsplitn(pieces, delimiter).map(Into::into).collect() } #[rhai_fn(name = "split_rev")] pub fn rsplit_char(string: &str, delimiter: char) -> Array { - string - .rsplit(delimiter) - .map(Into::::into) - .collect() + string.rsplit(delimiter).map(Into::into).collect() } #[rhai_fn(name = "split_rev")] pub fn rsplitn_char(string: &str, delimiter: char, segments: INT) -> Array { let pieces: usize = if segments < 1 { 1 } else { segments as usize }; - string - .rsplitn(pieces, delimiter) - .map(Into::::into) - .collect() + string.rsplitn(pieces, delimiter).map(Into::into).collect() } } }