From da4c7e7ed675c3bf405668739c3012d140856109 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:42 +0200 Subject: Adding upstream version 126.0. Signed-off-by: Daniel Baumann --- .../bitsdownload/bits_client/bits/src/wide.rs | 22 ++-------------------- .../bitsdownload/src/bits_interface/action.rs | 1 - .../bitsdownload/src/bits_interface/error.rs | 1 - 3 files changed, 2 insertions(+), 22 deletions(-) (limited to 'toolkit/components/bitsdownload') 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; @@ -19,20 +18,3 @@ impl> 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)] -- cgit v1.2.3