Skip to content

Commit

Permalink
Auto-fixed clippy::default_constructed_unit_structs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nyurik authored and danielrh committed Feb 21, 2024
1 parent 0e4ed95 commit 9d2a732
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/bin/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,7 @@ where
alloc,
f,
);
*work = SendAlloc(InternalSendAlloc::Join(MTJoinable(
ret,
PhantomData::default(),
)));
*work = SendAlloc(InternalSendAlloc::Join(MTJoinable(ret, PhantomData)));
}
}
impl<
Expand Down
4 changes: 2 additions & 2 deletions src/enc/backward_references/hash_to_binary_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
dict_num_lookups: 0,
dict_num_matches: 0,
},
_params: core::marker::PhantomData::<H10DefaultParams>::default(),
_params: core::marker::PhantomData::<H10DefaultParams>,
window_mask_: window_mask as usize,
invalid_pos_: invalid_pos,
buckets_: buckets,
Expand Down Expand Up @@ -215,7 +215,7 @@ where
buckets_: Buckets::new_uninit(m),
invalid_pos_: self.invalid_pos_,
forest: <Alloc as Allocator<u32>>::alloc_cell(m, self.forest.len()),
_params: core::marker::PhantomData::<Params>::default(),
_params: core::marker::PhantomData::<Params>,
};
ret.buckets_
.slice_mut()
Expand Down
2 changes: 1 addition & 1 deletion src/enc/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ impl<SliceType: SliceWrapper<u8>> SliceWrapper<u8> for FeatureFlagSliceType<Slic
#[cfg(not(feature = "external-literal-probability"))]
impl<SliceType: SliceWrapper<u8> + Default> Default for FeatureFlagSliceType<SliceType> {
fn default() -> Self {
FeatureFlagSliceType::<SliceType>(core::marker::PhantomData::<SliceType>::default())
FeatureFlagSliceType::<SliceType>(core::marker::PhantomData::<SliceType>)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/enc/multithreading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
let ret = spawn_work(extra_input, index, num_threads, input.clone(), alloc, f);
*work = SendAlloc(InternalSendAlloc::Join(MultiThreadedJoinable(
ret,
PhantomData::default(),
PhantomData,
)));
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/enc/singlethreading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ pub struct WorkerPool<A, B, C, D> {
}
pub fn new_work_pool<A, B, C, D>(_num_threads: usize) -> WorkerPool<A, B, C, D> {
WorkerPool::<A, B, C, D> {
a: PhantomData::default(),
b: PhantomData::default(),
c: PhantomData::default(),
d: PhantomData::default(),
a: PhantomData,
b: PhantomData,
c: PhantomData,
d: PhantomData,
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/enc/threading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ where
pub fn replace_with_default(&mut self) -> (Alloc, ExtraInput) {
match mem::replace(
&mut self.0,
InternalSendAlloc::SpawningOrJoining(PhantomData::default()),
InternalSendAlloc::SpawningOrJoining(PhantomData),
) {
InternalSendAlloc::A(alloc, extra_input) => (alloc, extra_input),
InternalSendAlloc::SpawningOrJoining(_) | InternalSendAlloc::Join(_) => {
Expand Down Expand Up @@ -534,7 +534,7 @@ where
} else {
match mem::replace(
&mut thread.0,
InternalSendAlloc::SpawningOrJoining(PhantomData::default()),
InternalSendAlloc::SpawningOrJoining(PhantomData),
) {
InternalSendAlloc::A(_, _) | InternalSendAlloc::SpawningOrJoining(_) => {
panic!("Thread not properly spawned")
Expand Down

0 comments on commit 9d2a732

Please sign in to comment.