Skip to content

Commit

Permalink
Make unit a unused phantom data in fmt::Arguments.
Browse files Browse the repository at this point in the history
The value of that type is never use, only the actual type parameter `N`
  • Loading branch information
hellow554 authored and iliekturtles committed Jan 27, 2024
1 parent 0933755 commit 35e0cfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/quantity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ macro_rules! quantity {
/// * `N`: Unit.
#[must_use = "method returns a new object"]
pub fn format_args<N>(
unit: N,
_unit: N,
style: $crate::fmt::DisplayStyle
) -> __system::fmt::Arguments<Dimension, N>
where
N: Unit
{
__system::fmt::Arguments {
dimension: $crate::lib::marker::PhantomData,
unit,
unit: $crate::lib::marker::PhantomData,
style,
}
}
Expand Down Expand Up @@ -378,7 +378,7 @@ macro_rules! quantity {
#[must_use = "method returns a new object and does not mutate the original one"]
pub fn into_format_args<N>(
self,
unit: N,
_unit: N,
style: $crate::fmt::DisplayStyle
) -> __system::fmt::QuantityArguments<Dimension, U, V, N>
where
Expand All @@ -387,7 +387,7 @@ macro_rules! quantity {
__system::fmt::QuantityArguments {
arguments: __system::fmt::Arguments {
dimension: $crate::lib::marker::PhantomData,
unit,
unit: $crate::lib::marker::PhantomData,
style,
},
quantity: self,
Expand Down
4 changes: 2 additions & 2 deletions src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,10 +1423,10 @@ macro_rules! system {
pub struct Arguments<D, N>
where
D: Dimension + ?Sized,
N: Unit,
N: Unit + ?Sized,
{
pub(super) dimension: $crate::lib::marker::PhantomData<D>,
pub(super) unit: N,
pub(super) unit: $crate::lib::marker::PhantomData<N>,
pub(super) style: DisplayStyle,
}

Expand Down

0 comments on commit 35e0cfa

Please sign in to comment.