Skip to content

Commit 8d309f7

Browse files
committed
fix warning about unnecessary parentheses in boxed_inline
1 parent ed8dc6a commit 8d309f7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

glib/src/boxed_inline.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ macro_rules! glib_boxed_inline_wrapper {
1313
#[repr(transparent)]
1414
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
1515
pub(crate) inner: $ffi_name,
16-
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
16+
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
1717
}
1818

1919
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
2020
#[inline]
2121
fn clone(&self) -> Self {
2222
Self {
2323
inner: std::clone::Clone::clone(&self.inner),
24-
phantom: std::marker::PhantomData,
24+
$(phantom: std::marker::PhantomData::<$($generic),+>)?
2525
}
2626
}
2727
}
@@ -45,15 +45,15 @@ macro_rules! glib_boxed_inline_wrapper {
4545
#[repr(transparent)]
4646
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
4747
pub(crate) inner: $ffi_name,
48-
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
48+
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
4949
}
5050

5151
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
5252
#[inline]
5353
fn clone(&self) -> Self {
5454
Self {
5555
inner: std::clone::Clone::clone(&self.inner),
56-
phantom: std::marker::PhantomData,
56+
$(phantom: std::marker::PhantomData::<$($generic),+>)?
5757
}
5858
}
5959
}
@@ -76,7 +76,7 @@ macro_rules! glib_boxed_inline_wrapper {
7676
#[repr(transparent)]
7777
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
7878
pub(crate) inner: $ffi_name,
79-
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
79+
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
8080
}
8181

8282
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
@@ -116,7 +116,7 @@ macro_rules! glib_boxed_inline_wrapper {
116116
#[repr(transparent)]
117117
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
118118
pub(crate) inner: $ffi_name,
119-
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
119+
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
120120
}
121121

122122
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
@@ -164,7 +164,7 @@ macro_rules! glib_boxed_inline_wrapper {
164164
init(v.as_mut_ptr());
165165
Self {
166166
inner: v.assume_init(),
167-
phantom: std::marker::PhantomData,
167+
$(phantom: std::marker::PhantomData::<$($generic),+>)?
168168
}
169169
}
170170
}
@@ -174,7 +174,7 @@ macro_rules! glib_boxed_inline_wrapper {
174174
unsafe fn unsafe_from(t: $ffi_name) -> Self {
175175
Self {
176176
inner: t,
177-
phantom: std::marker::PhantomData,
177+
$(phantom: std::marker::PhantomData::<$($generic),+>)?
178178
}
179179
}
180180
}
@@ -372,7 +372,7 @@ macro_rules! glib_boxed_inline_wrapper {
372372

373373
$crate::translate::Borrowed::new(Self {
374374
inner: std::ptr::read(ptr),
375-
phantom: std::marker::PhantomData,
375+
$(phantom: std::marker::PhantomData::<$($generic),+>)?
376376
})
377377
}
378378
}

0 commit comments

Comments
 (0)