Satisfy clippy.

This commit is contained in:
Stephen Chung
2022-11-25 09:46:13 +08:00
parent 2bf8e610a3
commit 6600862c22
13 changed files with 107 additions and 123 deletions

View File

@@ -12,7 +12,7 @@ use crate::{
};
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
use std::{borrow::Borrow, collections::BTreeMap, ops::Deref};
use std::{borrow::Borrow, ops::Deref};
/// Collection of special markers for custom syntax definition.
pub mod markers {
@@ -268,7 +268,7 @@ impl Engine {
.map_or(false, |m| m.contains_key(s))
{
self.custom_keywords
.get_or_insert_with(|| BTreeMap::new().into())
.get_or_insert_with(Default::default)
.insert(s.into(), None);
}
s.into()
@@ -304,7 +304,7 @@ impl Engine {
.map_or(false, |m| m.contains_key(s)))
{
self.custom_keywords
.get_or_insert_with(|| BTreeMap::new().into())
.get_or_insert_with(Default::default)
.insert(s.into(), None);
}
s.into()
@@ -391,7 +391,7 @@ impl Engine {
func: impl Fn(&mut EvalContext, &[Expression], &Dynamic) -> RhaiResult + SendSync + 'static,
) -> &mut Self {
self.custom_syntax
.get_or_insert_with(|| BTreeMap::new().into())
.get_or_insert_with(Default::default)
.insert(
key.into(),
CustomSyntax {