Bug 1899857 - Format Rust files and bring in line with MSRV. r=aleca DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D212152

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sean Burke 2024-05-30 19:11:08 +00:00
Родитель ebbecfbeb0
Коммит 9de1e5fe71
3 изменённых файлов: 20 добавлений и 8 удалений

Просмотреть файл

@ -189,8 +189,9 @@ impl EwsOutgoingServer {
let host = ews_url.host_str().ok_or(nserror::NS_ERROR_FAILURE)?;
let url = nsCString::from(format!("ews://{username}@{host}"));
let io_service = xpcom::get_service::<nsIIOService>(c"@mozilla.org/network/io-service;1")
.ok_or(nserror::NS_ERROR_FAILURE)?;
let io_service =
xpcom::get_service::<nsIIOService>(cstr::cstr!("@mozilla.org/network/io-service;1"))
.ok_or(nserror::NS_ERROR_FAILURE)?;
getter_addrefs(|p| unsafe { io_service.NewURI(&*url, ptr::null(), ptr::null(), p) })
}
@ -312,9 +313,10 @@ impl EwsOutgoingServer {
/// Open the file provided and read its content into a vector of bytes.
fn read_file(file: &nsIFile) -> Result<Vec<u8>, nsresult> {
let file_stream =
create_instance::<nsIFileInputStream>(c"@mozilla.org/network/file-input-stream;1")
.ok_or(nserror::NS_ERROR_FAILURE)?;
let file_stream = create_instance::<nsIFileInputStream>(cstr::cstr!(
"@mozilla.org/network/file-input-stream;1"
))
.ok_or(nserror::NS_ERROR_FAILURE)?;
// Open a stream from the file, and figure out how many bytes can be read
// from it.

Просмотреть файл

@ -52,7 +52,11 @@ impl Client {
}
/// Starts building an HTTP request to the given method and URL.
pub fn request<'rb>(&self, method: Method, url: &'rb Url) -> crate::Result<RequestBuilder<'rb>> {
pub fn request<'rb>(
&self,
method: Method,
url: &'rb Url,
) -> crate::Result<RequestBuilder<'rb>> {
RequestBuilder::new(method, url)
}

Просмотреть файл

@ -3,7 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::{
cell::Cell, future::Future, task::{Poll, Waker}
cell::Cell,
future::Future,
task::{Poll, Waker},
};
use cstr::cstr;
@ -53,7 +55,11 @@ impl SleepTimer {
});
unsafe {
timer.InitWithCallback(sleeper.coerce(), duration_in_ms, nsITimer::TYPE_ONE_SHOT as u32)
timer.InitWithCallback(
sleeper.coerce(),
duration_in_ms,
nsITimer::TYPE_ONE_SHOT as u32,
)
}
.to_result()?;