From ed2ac1713326df6b926062efcc6109a20cdf7c37 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 13 Aug 2018 14:24:22 +0300 Subject: smol_str to a crate --- crates/libeditor/Cargo.toml | 1 + crates/libeditor/src/lib.rs | 1 + crates/libeditor/src/symbols.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/libeditor') diff --git a/crates/libeditor/Cargo.toml b/crates/libeditor/Cargo.toml index fe688bc20..1d210f3c1 100644 --- a/crates/libeditor/Cargo.toml +++ b/crates/libeditor/Cargo.toml @@ -9,4 +9,5 @@ itertools = "0.7.8" superslice = "0.1.0" libsyntax2 = { path = "../libsyntax2" } +smol_str = { path = "../smol_str" } assert_eq_text = { path = "../assert_eq_text" } diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs index 1e88f1471..e5933cbd6 100644 --- a/crates/libeditor/src/lib.rs +++ b/crates/libeditor/src/lib.rs @@ -1,6 +1,7 @@ extern crate libsyntax2; extern crate superslice; extern crate itertools; +extern crate smol_str; mod extend_selection; mod symbols; diff --git a/crates/libeditor/src/symbols.rs b/crates/libeditor/src/symbols.rs index 5cd781c80..03f2313f7 100644 --- a/crates/libeditor/src/symbols.rs +++ b/crates/libeditor/src/symbols.rs @@ -1,3 +1,4 @@ +use smol_str::SmolStr; use libsyntax2::{ SyntaxKind, SyntaxNodeRef, SyntaxRoot, AstNode, ast::{self, NameOwner}, @@ -11,7 +12,7 @@ use TextRange; #[derive(Debug)] pub struct FileSymbol { pub parent: Option, - pub name: String, + pub name: SmolStr, pub name_range: TextRange, pub node_range: TextRange, pub kind: SyntaxKind, -- cgit v1.2.3