Skip to content

Commit b7455eb

Browse files
authored
Cleanup some deprecated, unused allows (#1067)
1 parent 9866310 commit b7455eb

File tree

3 files changed

+3
-51
lines changed

3 files changed

+3
-51
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@
217217
218218
#![doc(html_root_url = "https://docs.rs/cc/1.0")]
219219
#![cfg_attr(test, deny(warnings))]
220-
#![allow(deprecated)]
221220
#![deny(missing_docs)]
222221

223222
use std::borrow::Cow;

src/windows/com.rs

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All files in the project carrying such notice may not be copied, modified, or distributed
66
// except according to those terms.
77

8-
#![allow(unused)]
9-
108
use crate::windows::{
119
winapi::{IUnknown, Interface},
1210
windows_sys::{
@@ -16,10 +14,9 @@ use crate::windows::{
1614
};
1715
use std::{
1816
convert::TryInto,
19-
ffi::{OsStr, OsString},
20-
mem::ManuallyDrop,
17+
ffi::OsString,
2118
ops::Deref,
22-
os::windows::ffi::{OsStrExt, OsStringExt},
19+
os::windows::ffi::OsStringExt,
2320
ptr::{null, null_mut},
2421
slice::from_raw_parts,
2522
};
@@ -48,19 +45,6 @@ where
4845
assert!(!ptr.is_null());
4946
ComPtr(ptr)
5047
}
51-
/// Casts up the inheritance chain
52-
pub fn up<U>(self) -> ComPtr<U>
53-
where
54-
T: Deref<Target = U>,
55-
U: Interface,
56-
{
57-
ComPtr(self.into_raw() as *mut U)
58-
}
59-
/// Extracts the raw pointer.
60-
/// You are now responsible for releasing it yourself.
61-
pub fn into_raw(self) -> *mut T {
62-
ManuallyDrop::new(self).0
63-
}
6448
/// For internal use only.
6549
fn as_unknown(&self) -> &IUnknown {
6650
unsafe { &*(self.0 as *mut IUnknown) }
@@ -124,34 +108,3 @@ impl Drop for BStr {
124108
unsafe { SysFreeString(self.0) };
125109
}
126110
}
127-
128-
pub trait ToWide {
129-
fn to_wide(&self) -> Vec<u16>;
130-
fn to_wide_null(&self) -> Vec<u16>;
131-
}
132-
impl<T> ToWide for T
133-
where
134-
T: AsRef<OsStr>,
135-
{
136-
fn to_wide(&self) -> Vec<u16> {
137-
self.as_ref().encode_wide().collect()
138-
}
139-
fn to_wide_null(&self) -> Vec<u16> {
140-
self.as_ref().encode_wide().chain(Some(0)).collect()
141-
}
142-
}
143-
pub trait FromWide
144-
where
145-
Self: Sized,
146-
{
147-
fn from_wide(wide: &[u16]) -> Self;
148-
fn from_wide_null(wide: &[u16]) -> Self {
149-
let len = wide.iter().take_while(|&&c| c != 0).count();
150-
Self::from_wide(&wide[..len])
151-
}
152-
}
153-
impl FromWide for OsString {
154-
fn from_wide(wide: &[u16]) -> OsString {
155-
OsStringExt::from_wide(wide)
156-
}
157-
}

src/windows/find_tools.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ mod impl_ {
928928
for subkey in key.iter().filter_map(|k| k.ok()) {
929929
let val = subkey
930930
.to_str()
931-
.and_then(|s| s.trim_left_matches("v").replace('.', "").parse().ok());
931+
.and_then(|s| s.trim_start_matches("v").replace('.', "").parse().ok());
932932
let val = match val {
933933
Some(s) => s,
934934
None => continue,

0 commit comments

Comments
 (0)