summaryrefslogtreecommitdiffstats
path: root/toolkit/components/bitsdownload
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/bitsdownload')
-rw-r--r--toolkit/components/bitsdownload/bits_client/bits/src/wide.rs22
-rw-r--r--toolkit/components/bitsdownload/src/bits_interface/action.rs1
-rw-r--r--toolkit/components/bitsdownload/src/bits_interface/error.rs1
3 files changed, 2 insertions, 22 deletions
diff --git a/toolkit/components/bitsdownload/bits_client/bits/src/wide.rs b/toolkit/components/bitsdownload/bits_client/bits/src/wide.rs
index c108f8d629..b4f3157801 100644
--- a/toolkit/components/bitsdownload/bits_client/bits/src/wide.rs
+++ b/toolkit/components/bitsdownload/bits_client/bits/src/wide.rs
@@ -6,9 +6,8 @@
// Minimal null-terminated wide string support from wio.
-use std::ffi::{OsStr, OsString};
-use std::os::windows::ffi::{OsStrExt, OsStringExt};
-use std::slice;
+use std::ffi::OsStr;
+use std::os::windows::ffi::OsStrExt;
pub trait ToWideNull {
fn to_wide_null(&self) -> Vec<u16>;
@@ -19,20 +18,3 @@ impl<T: AsRef<OsStr>> ToWideNull for T {
self.as_ref().encode_wide().chain(Some(0)).collect()
}
}
-
-pub trait FromWidePtrNull {
- unsafe fn from_wide_ptr_null(wide: *const u16) -> Self;
-}
-
-impl FromWidePtrNull for OsString {
- unsafe fn from_wide_ptr_null(wide: *const u16) -> Self {
- assert!(!wide.is_null());
-
- for i in 0.. {
- if *wide.offset(i) == 0 {
- return Self::from_wide(&slice::from_raw_parts(wide, i as usize));
- }
- }
- unreachable!()
- }
-}
diff --git a/toolkit/components/bitsdownload/src/bits_interface/action.rs b/toolkit/components/bitsdownload/src/bits_interface/action.rs
index 1019e29827..c73d916a07 100644
--- a/toolkit/components/bitsdownload/src/bits_interface/action.rs
+++ b/toolkit/components/bitsdownload/src/bits_interface/action.rs
@@ -11,7 +11,6 @@
//! A value of type `ServiceAction` or `RequestAction` can easily be converted
//! to an `Action` using the `into()` method.
-use std::convert::From;
use xpcom::interfaces::nsIBits;
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
diff --git a/toolkit/components/bitsdownload/src/bits_interface/error.rs b/toolkit/components/bitsdownload/src/bits_interface/error.rs
index c046ae5e70..bed6975f9d 100644
--- a/toolkit/components/bitsdownload/src/bits_interface/error.rs
+++ b/toolkit/components/bitsdownload/src/bits_interface/error.rs
@@ -13,7 +13,6 @@ use bits_client::{
use comedy::error::HResult as ComedyError;
use nserror::{nsresult, NS_ERROR_FAILURE};
use nsstring::nsCString;
-use std::convert::From;
use xpcom::interfaces::nsIBits;
#[derive(Debug, PartialEq, Clone, Copy)]