Skip to content

Commit 9d2a732

Browse files
nyurikdanielrh
authored andcommitted
Auto-fixed clippy::default_constructed_unit_structs
This was automatic change using these commands ```sh cargo clippy --fix -- -A clippy::all -W clippy::default_constructed_unit_structs cargo fmt --all ``` * https://rust-lang.github.io/rust-clippy/master/index.html#/default_constructed_unit_structs
1 parent 0e4ed95 commit 9d2a732

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

src/bin/util.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,7 @@ where
289289
alloc,
290290
f,
291291
);
292-
*work = SendAlloc(InternalSendAlloc::Join(MTJoinable(
293-
ret,
294-
PhantomData::default(),
295-
)));
292+
*work = SendAlloc(InternalSendAlloc::Join(MTJoinable(ret, PhantomData)));
296293
}
297294
}
298295
impl<

src/enc/backward_references/hash_to_binary_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ where
179179
dict_num_lookups: 0,
180180
dict_num_matches: 0,
181181
},
182-
_params: core::marker::PhantomData::<H10DefaultParams>::default(),
182+
_params: core::marker::PhantomData::<H10DefaultParams>,
183183
window_mask_: window_mask as usize,
184184
invalid_pos_: invalid_pos,
185185
buckets_: buckets,
@@ -215,7 +215,7 @@ where
215215
buckets_: Buckets::new_uninit(m),
216216
invalid_pos_: self.invalid_pos_,
217217
forest: <Alloc as Allocator<u32>>::alloc_cell(m, self.forest.len()),
218-
_params: core::marker::PhantomData::<Params>::default(),
218+
_params: core::marker::PhantomData::<Params>,
219219
};
220220
ret.buckets_
221221
.slice_mut()

src/enc/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<SliceType: SliceWrapper<u8>> SliceWrapper<u8> for FeatureFlagSliceType<Slic
385385
#[cfg(not(feature = "external-literal-probability"))]
386386
impl<SliceType: SliceWrapper<u8> + Default> Default for FeatureFlagSliceType<SliceType> {
387387
fn default() -> Self {
388-
FeatureFlagSliceType::<SliceType>(core::marker::PhantomData::<SliceType>::default())
388+
FeatureFlagSliceType::<SliceType>(core::marker::PhantomData::<SliceType>)
389389
}
390390
}
391391

src/enc/multithreading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ where
107107
let ret = spawn_work(extra_input, index, num_threads, input.clone(), alloc, f);
108108
*work = SendAlloc(InternalSendAlloc::Join(MultiThreadedJoinable(
109109
ret,
110-
PhantomData::default(),
110+
PhantomData,
111111
)));
112112
}
113113
}

src/enc/singlethreading.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ pub struct WorkerPool<A, B, C, D> {
172172
}
173173
pub fn new_work_pool<A, B, C, D>(_num_threads: usize) -> WorkerPool<A, B, C, D> {
174174
WorkerPool::<A, B, C, D> {
175-
a: PhantomData::default(),
176-
b: PhantomData::default(),
177-
c: PhantomData::default(),
178-
d: PhantomData::default(),
175+
a: PhantomData,
176+
b: PhantomData,
177+
c: PhantomData,
178+
d: PhantomData,
179179
}
180180
}
181181

src/enc/threading.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ where
135135
pub fn replace_with_default(&mut self) -> (Alloc, ExtraInput) {
136136
match mem::replace(
137137
&mut self.0,
138-
InternalSendAlloc::SpawningOrJoining(PhantomData::default()),
138+
InternalSendAlloc::SpawningOrJoining(PhantomData),
139139
) {
140140
InternalSendAlloc::A(alloc, extra_input) => (alloc, extra_input),
141141
InternalSendAlloc::SpawningOrJoining(_) | InternalSendAlloc::Join(_) => {
@@ -534,7 +534,7 @@ where
534534
} else {
535535
match mem::replace(
536536
&mut thread.0,
537-
InternalSendAlloc::SpawningOrJoining(PhantomData::default()),
537+
InternalSendAlloc::SpawningOrJoining(PhantomData),
538538
) {
539539
InternalSendAlloc::A(_, _) | InternalSendAlloc::SpawningOrJoining(_) => {
540540
panic!("Thread not properly spawned")

0 commit comments

Comments
 (0)