1
Fork 0

Prefer Default::default over FxHash*::default in struct constructors

This commit is contained in:
Oliver Scherer 2018-10-16 16:57:53 +02:00
parent ee81739dc1
commit 3c9258e604
82 changed files with 237 additions and 362 deletions

View file

@ -124,6 +124,7 @@ impl StableFilemapId {
// SourceMap
//
#[derive(Default)]
pub(super) struct SourceMapFiles {
pub(super) file_maps: Vec<Lrc<SourceFile>>,
stable_id_to_source_file: FxHashMap<StableFilemapId, Lrc<SourceFile>>
@ -143,10 +144,7 @@ pub struct SourceMap {
impl SourceMap {
pub fn new(path_mapping: FilePathMapping) -> SourceMap {
SourceMap {
files: Lock::new(SourceMapFiles {
file_maps: Vec::new(),
stable_id_to_source_file: FxHashMap::default(),
}),
files: Default::default(),
file_loader: Box::new(RealFileLoader),
path_mapping,
doctest_offset: None,
@ -166,10 +164,7 @@ impl SourceMap {
path_mapping: FilePathMapping)
-> SourceMap {
SourceMap {
files: Lock::new(SourceMapFiles {
file_maps: Vec::new(),
stable_id_to_source_file: FxHashMap::default(),
}),
files: Default::default(),
file_loader: file_loader,
path_mapping,
doctest_offset: None,