Skip to content

Commit 2a68db2

Browse files
committed
[REF] remove paths from RootSymbol
The `paths` field in `RootSymbol` has no purpose and is always an empty vector.
1 parent d2e8a97 commit 2a68db2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

server/src/core/symbols/root_symbol.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use super::symbol::Symbol;
77
pub struct RootSymbol {
88
pub name: OYarn,
99
pub entry_point: Option<Rc<RefCell<EntryPoint>>>,
10-
pub paths: Vec<String>,
1110
pub weak_self: Option<Weak<RefCell<Symbol>>>,
1211
pub parent: Option<Weak<RefCell<Symbol>>>,
1312
pub module_symbols: HashMap<OYarn, Rc<RefCell<Symbol>>>,
@@ -18,7 +17,6 @@ impl RootSymbol {
1817
pub fn new() -> Self {
1918
Self {
2019
name: oyarn!("Root"),
21-
paths: vec![],
2220
weak_self: None,
2321
entry_point: None,
2422
parent: None,

server/src/core/symbols/symbol.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ impl Symbol {
844844

845845
pub fn paths(&self) -> Vec<String> {
846846
match self {
847-
Symbol::Root(r) => r.paths.clone(),
847+
Symbol::Root(_) => vec![],
848848
Symbol::Namespace(n) => n.paths(),
849849
Symbol::DiskDir(d) => vec![d.path.clone()],
850850
Symbol::Package(p) => p.paths(),
@@ -859,7 +859,7 @@ impl Symbol {
859859
}
860860
pub fn add_path(&mut self, path: String) {
861861
match self {
862-
Symbol::Root(r) => r.paths.push(path),
862+
Symbol::Root(_) => {},
863863
Symbol::Namespace(n) => {
864864
n.directories.push(NamespaceDirectory { path: path, module_symbols: HashMap::new() });
865865
},

0 commit comments

Comments
 (0)