Skip to content

Commit

Permalink
Fix new nightly warning about unused return value (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jul 18, 2022
1 parent 2f2e2c6 commit 14a9517
Show file tree
Hide file tree
Showing 33 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion crates/libs/bindgen/src/delegates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn gen_win_delegate(gen: &Gen, def: TypeDef) -> TokenStream {
let remaining = (*this).count.release();

if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}

remaining
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/implement/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub fn implement(attributes: proc_macro::TokenStream, original_type: proc_macro:
let remaining = self.count.release();
if remaining == 0 {
unsafe {
::std::boxed::Box::from_raw(self as *const Self as *mut Self);
let _ = ::std::boxed::Box::from_raw(self as *const Self as *mut Self);
}
}
remaining
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ impl<F: FnMut(&::core::option::Option<IBackgroundTaskInstance>, BackgroundTaskCa
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1327,7 +1327,7 @@ impl<F: FnMut(&::core::option::Option<BackgroundTaskRegistration>, &::core::opti
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1567,7 +1567,7 @@ impl<F: FnMut(&::core::option::Option<BackgroundTaskRegistration>, &::core::opti
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ impl<F: FnMut(&::core::option::Option<DataProviderRequest>) -> ::windows::core::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -3787,7 +3787,7 @@ impl<F: FnMut(&::core::option::Option<ShareProviderOperation>) -> ::windows::cor
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ impl<F: FnMut(&::core::option::Option<PaymentRequest>, &::core::option::Option<P
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ impl<F: FnMut() -> ::windows::core::Result<()> + ::core::marker::Send + 'static>
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Data/Text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl<F: FnMut(&::core::option::Option<super::super::Foundation::Collections::IIt
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1767,7 +1767,7 @@ impl<F: FnMut(&::core::option::Option<super::super::Foundation::Collections::IIt
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ impl<F: FnMut(&::core::option::Option<PerceptionFaceAuthenticationGroup>) -> ::w
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1899,7 +1899,7 @@ impl<F: FnMut(&::core::option::Option<PerceptionFaceAuthenticationGroup>) -> ::w
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/Windows/Devices/SmartCards/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5048,7 +5048,7 @@ impl<F: FnMut(&::core::option::Option<SmartCardProvisioning>, &::core::option::O
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Devices/Sms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4154,7 +4154,7 @@ impl<F: FnMut(&::core::option::Option<SmsDevice>) -> ::windows::core::Result<()>
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -4884,7 +4884,7 @@ impl<F: FnMut(&::core::option::Option<SmsDevice>, &::core::option::Option<SmsMes
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Foundation/Collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@ impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -2687,7 +2687,7 @@ impl<T: ::windows::core::RuntimeType + 'static, F: FnMut(&::core::option::Option
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
18 changes: 9 additions & 9 deletions crates/libs/windows/src/Windows/Foundation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<F: FnMut(&::core::option::Option<IAsyncAction>, AsyncStatus) -> ::windows::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -147,7 +147,7 @@ impl<TProgress: ::windows::core::RuntimeType + 'static, F: FnMut(&::core::option
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -245,7 +245,7 @@ impl<TProgress: ::windows::core::RuntimeType + 'static, F: FnMut(&::core::option
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -343,7 +343,7 @@ impl<TResult: ::windows::core::RuntimeType + 'static, F: FnMut(&::core::option::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -445,7 +445,7 @@ impl<TResult: ::windows::core::RuntimeType + 'static, TProgress: ::windows::core
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -548,7 +548,7 @@ impl<TResult: ::windows::core::RuntimeType + 'static, TProgress: ::windows::core
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -819,7 +819,7 @@ impl<F: FnMut() -> ::windows::core::Result<()> + ::core::marker::Send + 'static>
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -913,7 +913,7 @@ impl<T: ::windows::core::RuntimeType + 'static, F: FnMut(&::core::option::Option
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -4194,7 +4194,7 @@ impl<TSender: ::windows::core::RuntimeType + 'static, TResult: ::windows::core::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<F: FnMut(&::core::option::Option<GameListEntry>) -> ::windows::core::Result
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -503,7 +503,7 @@ impl<F: FnMut(&::windows::core::HSTRING) -> ::windows::core::Result<()> + ::core
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/Windows/Graphics/Display/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>) -> ::windo
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/Windows/Graphics/Printing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3118,7 +3118,7 @@ impl<F: FnMut(&::core::option::Option<PrintTaskSourceRequestedArgs>) -> ::window
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/Windows/Graphics/Printing3D/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ impl<F: FnMut(&::core::option::Option<Print3DTaskSourceRequestedArgs>) -> ::wind
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Media/Capture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12038,7 +12038,7 @@ impl<F: FnMut(&::core::option::Option<MediaCapture>, &::core::option::Option<Med
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -13802,7 +13802,7 @@ impl<F: FnMut(&::core::option::Option<MediaCapture>) -> ::windows::core::Result<
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/windows/src/Windows/Media/Devices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ impl<F: FnMut(&::core::option::Option<CallControl>) -> ::windows::core::Result<(
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1810,7 +1810,7 @@ impl<F: FnMut(&::core::option::Option<CallControl>, &::core::option::Option<Dial
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -5282,7 +5282,7 @@ impl<F: FnMut(&::core::option::Option<CallControl>, &::core::option::Option<Keyp
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -6569,7 +6569,7 @@ impl<F: FnMut(&::core::option::Option<CallControl>, &::core::option::Option<Redi
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
6 changes: 3 additions & 3 deletions crates/libs/windows/src/Windows/Media/Protection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<F: FnMut(&::core::option::Option<MediaProtectionManager>, &::core::option::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1211,7 +1211,7 @@ impl<F: FnMut(&::core::option::Option<MediaProtectionManager>) -> ::windows::cor
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1679,7 +1679,7 @@ impl<F: FnMut(&::core::option::Option<MediaProtectionManager>, &::core::option::
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3164,7 +3164,7 @@ impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>) -> ::windo
let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
::windows::core::alloc::boxed::Box::from_raw(this);
let _ = ::windows::core::alloc::boxed::Box::from_raw(this);
}
remaining
}
Expand Down
Loading

0 comments on commit 14a9517

Please sign in to comment.