@@ -13,7 +13,6 @@ use crate::{Context, SymbolKind};
1313
1414#[ derive( Debug , Clone ) ]
1515pub struct BarrelExport {
16- pub export_name : String ,
1716 pub source_path : String ,
1817 pub kind : SymbolKind ,
1918 pub source_file_path : Option < PathBuf > ,
@@ -72,7 +71,6 @@ fn collect_into(
7271 exports. insert (
7372 "default" . to_string ( ) ,
7473 BarrelExport {
75- export_name : "default" . to_string ( ) ,
7674 source_path : barrel_export_path ( file, barrel_dir, alias) ,
7775 kind : SymbolKind :: Default ,
7876 source_file_path : Some ( file. to_path_buf ( ) ) ,
@@ -99,11 +97,9 @@ fn handle_export_all(
9997
10098 match & decl. exported {
10199 Some ( name_node) => {
102- let name = name_node. name ( ) . to_string ( ) ;
103100 exports. insert (
104- name. clone ( ) ,
101+ name_node . name ( ) . to_string ( ) ,
105102 BarrelExport {
106- export_name : name,
107103 source_path : resolve_export_path ( from_module, alias) ,
108104 kind : SymbolKind :: Named ,
109105 source_file_path : resolved,
@@ -132,17 +128,14 @@ fn handle_export_named(
132128 let source_path = resolve_export_path ( from_module, alias) ;
133129
134130 for spec in & decl. specifiers {
135- let exported = spec. exported . name ( ) . to_string ( ) ;
136- let original = spec. local . name ( ) ;
137- let kind = if original == "default" {
131+ let kind = if spec. local . name ( ) == "default" {
138132 SymbolKind :: Default
139133 } else {
140134 SymbolKind :: Named
141135 } ;
142136 exports. insert (
143- exported. clone ( ) ,
137+ spec . exported . name ( ) . to_string ( ) ,
144138 BarrelExport {
145- export_name : exported,
146139 source_path : source_path. clone ( ) ,
147140 kind,
148141 source_file_path : resolved. clone ( ) ,
@@ -153,9 +146,8 @@ fn handle_export_named(
153146 let source_path = barrel_export_path ( file, barrel_dir, alias) ;
154147 for name in declaration_names ( declaration) {
155148 exports. insert (
156- name. clone ( ) ,
149+ name,
157150 BarrelExport {
158- export_name : name,
159151 source_path : source_path. clone ( ) ,
160152 kind : SymbolKind :: Named ,
161153 source_file_path : Some ( file. to_path_buf ( ) ) ,
0 commit comments