Satisfy clippy.
This commit is contained in:
@@ -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 {
|
||||
|
@@ -35,7 +35,6 @@ pub mod definitions;
|
||||
|
||||
use crate::{Dynamic, Engine, Identifier};
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
#[cfg(feature = "no_std")]
|
||||
use std::prelude::v1::*;
|
||||
|
||||
@@ -109,7 +108,7 @@ impl Engine {
|
||||
#[inline(always)]
|
||||
pub fn disable_symbol(&mut self, symbol: impl Into<Identifier>) -> &mut Self {
|
||||
self.disabled_symbols
|
||||
.get_or_insert_with(|| BTreeSet::new().into())
|
||||
.get_or_insert_with(Default::default)
|
||||
.insert(symbol.into());
|
||||
self
|
||||
}
|
||||
@@ -199,7 +198,7 @@ impl Engine {
|
||||
|
||||
// Add to custom keywords
|
||||
self.custom_keywords
|
||||
.get_or_insert_with(|| std::collections::BTreeMap::new().into())
|
||||
.get_or_insert_with(Default::default)
|
||||
.insert(keyword.into(), Some(precedence));
|
||||
|
||||
Ok(self)
|
||||
|
@@ -720,8 +720,7 @@ impl Engine {
|
||||
}
|
||||
|
||||
register_static_module_raw(
|
||||
self.global_sub_modules
|
||||
.get_or_insert_with(|| BTreeMap::new().into()),
|
||||
self.global_sub_modules.get_or_insert_with(Default::default),
|
||||
name.as_ref(),
|
||||
module,
|
||||
);
|
||||
|
Reference in New Issue
Block a user