aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/ast_editor.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-07 18:54:57 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-07 18:54:57 +0100
commit6ceaea9e9505cfa07c0a76b590b62fa9615061cd (patch)
treed7dee875aad8182a83195dba6d767d26dcff53d3 /crates/ra_assists/src/ast_editor.rs
parent70cd5ffbf5f2283fc4986c581d225987620b5335 (diff)
parent1667b5cf52a8f2854c7299242820c951eab50f7a (diff)
Merge #1255
1255: switch to once_cell from lazy_static r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/ast_editor.rs')
-rw-r--r--crates/ra_assists/src/ast_editor.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_assists/src/ast_editor.rs b/crates/ra_assists/src/ast_editor.rs
index 726e5c0a3..aa7aeaabb 100644
--- a/crates/ra_assists/src/ast_editor.rs
+++ b/crates/ra_assists/src/ast_editor.rs
@@ -289,12 +289,10 @@ fn ast_node_from_file_text<N: AstNode>(text: &str) -> TreeArc<N> {
289} 289}
290 290
291mod tokens { 291mod tokens {
292 use lazy_static::lazy_static; 292 use once_cell::sync::Lazy;
293 use ra_syntax::{AstNode, SourceFile, TreeArc, SyntaxToken, SyntaxKind::*}; 293 use ra_syntax::{AstNode, SourceFile, TreeArc, SyntaxToken, SyntaxKind::*};
294 294
295 lazy_static! { 295 static SOURCE_FILE: Lazy<TreeArc<SourceFile>> = Lazy::new(|| SourceFile::parse(",\n; ;"));
296 static ref SOURCE_FILE: TreeArc<SourceFile> = SourceFile::parse(",\n; ;");
297 }
298 296
299 pub(crate) fn comma() -> SyntaxToken<'static> { 297 pub(crate) fn comma() -> SyntaxToken<'static> {
300 SOURCE_FILE 298 SOURCE_FILE