diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-14 15:24:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-14 15:55:39 +0200 |
| commit | 6ae6d86b9c6fefe6c5379ac1b20ea90634c09c81 (patch) | |
| tree | 2504c3b46807be148b9efbadf9b23e57bb77b8f3 /src/syntax/ident.rs | |
| parent | fcb4e451186067cdf6efe3c14cbfa7561b366a6c (diff) | |
Separate type for string values
Diffstat (limited to 'src/syntax/ident.rs')
| -rw-r--r-- | src/syntax/ident.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/syntax/ident.rs b/src/syntax/ident.rs index 462361a5..2a7df8e1 100644 --- a/src/syntax/ident.rs +++ b/src/syntax/ident.rs @@ -23,14 +23,11 @@ pub struct Ident { impl Ident { /// Create a new identifier from a string checking that it is a valid. pub fn new( - string: impl AsRef<str> + Into<String>, + string: impl AsRef<str> + Into<EcoString>, span: impl Into<Span>, ) -> Option<Self> { if is_ident(string.as_ref()) { - Some(Self { - span: span.into(), - string: EcoString::from_str(string), - }) + Some(Self { span: span.into(), string: string.into() }) } else { None } |
