Reduce unnecessary generics.

This commit is contained in:
Stephen Chung
2022-10-20 15:31:57 +08:00
parent f8888c83e7
commit c24794187f
8 changed files with 88 additions and 30 deletions

View File

@@ -10,9 +10,9 @@ use crate::{
reify, Dynamic, Engine, EvalContext, Identifier, ImmutableString, LexError, Position,
RhaiResult, StaticVec,
};
use std::ops::Deref;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
use std::{borrow::Borrow, ops::Deref};
/// Collection of special markers for custom syntax definition.
pub mod markers {
@@ -145,6 +145,14 @@ impl Expression<'_> {
}
}
impl Borrow<Expr> for Expression<'_> {
#[inline(always)]
#[must_use]
fn borrow(&self) -> &Expr {
self.0
}
}
impl AsRef<Expr> for Expression<'_> {
#[inline(always)]
#[must_use]