diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-15 16:59:49 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-15 17:06:43 +0100 |
| commit | 63c274e7f6aa3a8c3f43abb91935ec924a186f73 (patch) | |
| tree | 193777ff773c6b547c6ef828ddf9750694fae7bc /src/eval/function.rs | |
| parent | 8a38899c98b4f9829b2d1f21c8fee66d254d20c6 (diff) | |
Make clippy happier and remove `Str`
Diffstat (limited to 'src/eval/function.rs')
| -rw-r--r-- | src/eval/function.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/eval/function.rs b/src/eval/function.rs index cbbc0b36..c83d8b2b 100644 --- a/src/eval/function.rs +++ b/src/eval/function.rs @@ -1,7 +1,7 @@ use std::fmt::{self, Debug, Formatter, Write}; use std::rc::Rc; -use super::{Cast, EvalContext, Str, Value}; +use super::{Cast, EvalContext, Value}; use crate::diag::{At, TypResult}; use crate::syntax::{Span, Spanned}; use crate::util::EcoString; @@ -52,7 +52,10 @@ impl Debug for Function { impl PartialEq for Function { fn eq(&self, other: &Self) -> bool { // We cast to thin pointers for comparison. - Rc::as_ptr(&self.0) as *const () == Rc::as_ptr(&other.0) as *const () + std::ptr::eq( + Rc::as_ptr(&self.0) as *const (), + Rc::as_ptr(&other.0) as *const (), + ) } } @@ -71,7 +74,7 @@ pub struct Arg { /// The span of the whole argument. pub span: Span, /// The name of the argument (`None` for positional arguments). - pub name: Option<Str>, + pub name: Option<EcoString>, /// The value of the argument. pub value: Spanned<Value>, } @@ -173,7 +176,7 @@ impl Args { } /// Reinterpret these arguments as actually being a dictionary key. - pub fn into_key(self) -> TypResult<Str> { + pub fn into_key(self) -> TypResult<EcoString> { self.into_castable("key") } |
