Prefer Default::default
over FxHash*::default
in struct constructors
This commit is contained in:
parent
ee81739dc1
commit
3c9258e604
82 changed files with 237 additions and 362 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue