Skip to content

Commit 41ee980

Browse files
committed
rustc_metadata: Give a constructor to CratePaths
1 parent 0aed810 commit 41ee980

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/librustc_metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'a> CrateLoader<'a> {
207207
let root = if let Some(root) = root {
208208
root
209209
} else {
210-
crate_paths = CratePaths { name: crate_root.name, source: source.clone() };
210+
crate_paths = CratePaths::new(crate_root.name, source.clone());
211211
&crate_paths
212212
};
213213

src/librustc_metadata/locator.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,14 @@ crate struct CrateLocator<'a> {
281281
}
282282

283283
crate struct CratePaths {
284-
pub name: Symbol,
285-
pub source: CrateSource,
284+
name: Symbol,
285+
source: CrateSource,
286+
}
287+
288+
impl CratePaths {
289+
crate fn new(name: Symbol, source: CrateSource) -> CratePaths {
290+
CratePaths { name, source }
291+
}
286292
}
287293

288294
#[derive(Copy, Clone, PartialEq)]

0 commit comments

Comments
 (0)