diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-05-20 16:40:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 16:40:55 -0400 |
commit | 1fcecb6789c3f111bc1554766ba9347afcfd02dc (patch) | |
tree | 19cd1b121412b992994b2fe4bea0463793d3986e /cli/lsp/tsc.rs | |
parent | e7c894e8f54ebd2d9fd61c97a265906ac54e2068 (diff) |
refactor: upgrade to deno_ast 0.15 (#14680)
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r-- | cli/lsp/tsc.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 1448c8c96..40efcb99a 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -154,7 +154,7 @@ impl TsServer { #[derive(Debug, Clone)] struct AssetDocumentInner { specifier: ModuleSpecifier, - text: Arc<String>, + text: Arc<str>, line_index: Arc<LineIndex>, maybe_navigation_tree: Option<Arc<NavigationTree>>, } @@ -169,7 +169,7 @@ impl AssetDocument { let text = text.as_ref(); Self(Arc::new(AssetDocumentInner { specifier, - text: Arc::new(text.to_string()), + text: text.into(), line_index: Arc::new(LineIndex::new(text)), maybe_navigation_tree: None, })) @@ -189,7 +189,7 @@ impl AssetDocument { })) } - pub fn text(&self) -> Arc<String> { + pub fn text(&self) -> Arc<str> { self.0.text.clone() } @@ -3114,7 +3114,7 @@ mod tests { specifier.clone(), *version, language_id.clone(), - Arc::new(source.to_string()), + (*source).into(), ); } StateSnapshot { |