remove redundant clone of identifier
This commit is contained in:
parent
c4cfb9112e
commit
076ee7ca4e
@ -152,3 +152,9 @@ impl Default for Identifier {
|
|||||||
Self(String::new())
|
Self(String::new())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Identifier {
|
||||||
|
pub fn into_inner(self) -> String {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
}
|
@ -14,7 +14,7 @@ use super::css_function::{eat_calc_args, eat_progid, try_eat_url};
|
|||||||
use crate::args::eat_call_args;
|
use crate::args::eat_call_args;
|
||||||
use crate::builtin::GLOBAL_FUNCTIONS;
|
use crate::builtin::GLOBAL_FUNCTIONS;
|
||||||
use crate::color::{Color, NAMED_COLORS};
|
use crate::color::{Color, NAMED_COLORS};
|
||||||
use crate::common::{Brackets, ListSeparator, Op, QuoteKind};
|
use crate::common::{Brackets, ListSeparator, Op, QuoteKind, Identifier};
|
||||||
use crate::error::SassResult;
|
use crate::error::SassResult;
|
||||||
use crate::scope::Scope;
|
use crate::scope::Scope;
|
||||||
use crate::selector::Selector;
|
use crate::selector::Selector;
|
||||||
@ -573,13 +573,14 @@ impl Value {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(Token { kind: '(', .. }) = toks.peek() {
|
if let Some(Token { kind: '(', .. }) = toks.peek() {
|
||||||
|
let as_ident = Identifier::from(&s);
|
||||||
toks.next();
|
toks.next();
|
||||||
let func = match scope.get_fn(Spanned {
|
let func = match scope.get_fn(Spanned {
|
||||||
node: s.clone(),
|
node: as_ident.clone(),
|
||||||
span,
|
span,
|
||||||
}) {
|
}) {
|
||||||
Ok(f) => f,
|
Ok(f) => f,
|
||||||
Err(_) => match GLOBAL_FUNCTIONS.get(s.replace('_', "-").as_str()) {
|
Err(_) => match GLOBAL_FUNCTIONS.get(as_ident.into_inner().as_str()) {
|
||||||
Some(f) => {
|
Some(f) => {
|
||||||
return Ok(IntermediateValue::Value(f.0(
|
return Ok(IntermediateValue::Value(f.0(
|
||||||
eat_call_args(toks)?,
|
eat_call_args(toks)?,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user