diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-31 16:06:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-31 16:47:00 +0100 |
| commit | 20b1a38414101f842a6d9201133a5aaaa45a7cec (patch) | |
| tree | 2365453d4dfdebfa11d618baad1a36c65b62d7c7 /src/parse/tokens.rs | |
| parent | fa57d86ed981373b66804972147bf59cab920e6b (diff) | |
Switch from `Rc` to `Arc`
Diffstat (limited to 'src/parse/tokens.rs')
| -rw-r--r-- | src/parse/tokens.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs index 27da3b80..970c0dd6 100644 --- a/src/parse/tokens.rs +++ b/src/parse/tokens.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::sync::Arc; use super::{ is_id_continue, is_id_start, is_newline, resolve_hex, resolve_raw, resolve_string, @@ -321,7 +321,7 @@ impl<'s> Tokens<'s> { // Special case for empty inline block. if backticks == 2 { - return NodeKind::Raw(Rc::new(RawNode { + return NodeKind::Raw(Arc::new(RawNode { text: EcoString::new(), lang: None, block: false, @@ -341,7 +341,7 @@ impl<'s> Tokens<'s> { if found == backticks { let end = self.s.index() - found as usize; - NodeKind::Raw(Rc::new(resolve_raw( + NodeKind::Raw(Arc::new(resolve_raw( column, backticks, self.s.get(start .. end), @@ -393,7 +393,7 @@ impl<'s> Tokens<'s> { }; if terminated { - NodeKind::Math(Rc::new(MathNode { + NodeKind::Math(Arc::new(MathNode { formula: self.s.get(start .. end).into(), display, })) @@ -581,7 +581,7 @@ mod tests { } fn Raw(text: &str, lang: Option<&str>, block: bool) -> NodeKind { - NodeKind::Raw(Rc::new(RawNode { + NodeKind::Raw(Arc::new(RawNode { text: text.into(), lang: lang.map(Into::into), block, @@ -589,7 +589,7 @@ mod tests { } fn Math(formula: &str, display: bool) -> NodeKind { - NodeKind::Math(Rc::new(MathNode { formula: formula.into(), display })) + NodeKind::Math(Arc::new(MathNode { formula: formula.into(), display })) } fn Str(string: &str) -> NodeKind { |
