Commit 396275b3 authored by Sylvestre Ledru's avatar Sylvestre Ledru
Browse files

Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio

# ignore-this-changeset

Depends on D96608

Differential Revision: https://phabricator.services.mozilla.com/D96609
parent c7deb74f
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -3769,11 +3769,7 @@ pub extern "C" fn wr_dump_display_list(
    unsafe {
        let gecko = CString::new("Gecko").unwrap();
        let sink = CString::new(sink.into_inner()).unwrap();
        __android_log_write(
            4, /* info */
            gecko.as_ptr(),
            sink.as_ptr(),
        );
        __android_log_write(4 /* info */, gecko.as_ptr(), sink.as_ptr());
    }

    #[cfg(not(target_os = "android"))]
+12 −3
Original line number Diff line number Diff line
@@ -553,8 +553,15 @@ pub extern "C" fn neqo_http3conn_event(
                }
            }
            Http3ClientEvent::DataReadable { stream_id } => Http3Event::DataReadable { stream_id },
            Http3ClientEvent::Reset { stream_id, error, local } =>
                Http3Event::Reset { stream_id, error, local },
            Http3ClientEvent::Reset {
                stream_id,
                error,
                local,
            } => Http3Event::Reset {
                stream_id,
                error,
                local,
            },
            Http3ClientEvent::PushPromise {
                push_id,
                request_stream_id,
@@ -589,7 +596,9 @@ pub extern "C" fn neqo_http3conn_event(
                Http3Event::PushDataReadable { push_id }
            }
            Http3ClientEvent::PushCanceled { push_id } => Http3Event::PushCanceled { push_id },
            Http3ClientEvent::PushReset { push_id, error } => Http3Event::PushReset { push_id, error },
            Http3ClientEvent::PushReset { push_id, error } => {
                Http3Event::PushReset { push_id, error }
            }
            Http3ClientEvent::RequestsCreatable => Http3Event::RequestsCreatable,
            Http3ClientEvent::AuthenticationNeeded => Http3Event::AuthenticationNeeded,
            Http3ClientEvent::ZeroRttRejected => Http3Event::ZeroRttRejected,
+31 −39
Original line number Diff line number Diff line
@@ -95,9 +95,7 @@ impl HttpServer for Http3TestServer {
                        ),
                    ];

                    let path_hdr = headers
                        .iter()
                        .find(|(k, _)| k == ":path");
                    let path_hdr = headers.iter().find(|(k, _)| k == ":path");
                    match path_hdr {
                        Some((_, path)) if !path.is_empty() => {
                            qtrace!("Serve request {}", path);
@@ -134,9 +132,7 @@ impl HttpServer for Http3TestServer {
                                    .stream_reset(Error::HttpRequestRejected.code())
                                    .unwrap();
                            } else if path == "/.well-known/http-opportunistic" {
                                let host_hdr = headers
                                    .iter()
                                    .find(|(k, _)| k == ":authority");
                                let host_hdr = headers.iter().find(|(k, _)| k == ":authority");
                                match host_hdr {
                                    Some((_, host)) if !host.is_empty() => {
                                        let mut content = b"[\"http://".to_vec();
@@ -253,10 +249,7 @@ impl HttpServer for Http3TestServer {
                                .set_response(
                                    &[
                                        (String::from(":status"), String::from("200")),
                                       (
                                           String::from("Cache-Control"),
                                           String::from("no-cache"),
                                       ),
                                        (String::from("Cache-Control"), String::from("no-cache")),
                                        (String::from("x-data-received-length"), r.to_string()),
                                        (
                                            String::from("content-length"),
@@ -446,8 +439,7 @@ impl ServersRunner {
        let cid_mgr = Rc::new(RefCell::new(FixedConnectionIdManager::new(10)));

        if http3 {
            Box::new(
                Http3TestServer::new(
            Box::new(Http3TestServer::new(
                Http3Server::new(
                    Instant::now(),
                    &[" HTTP2 Test Cert"],
@@ -459,9 +451,9 @@ impl ServersRunner {
                        max_table_size_decoder: MAX_TABLE_SIZE,
                        max_blocked_streams: MAX_BLOCKED_STREAMS,
                    },
                    ).expect("We cannot make a server!")
                )
                )
                .expect("We cannot make a server!"),
            ))
        } else {
            Box::new(
                Server::new(
+5 −1
Original line number Diff line number Diff line
@@ -120,7 +120,11 @@ impl Bridge {
        )
    );

    punt!(begin_oauth_flow, scopes: &ThinVec<nsCString>, entry_point: &nsACString);
    punt!(
        begin_oauth_flow,
        scopes: &ThinVec<nsCString>,
        entry_point: &nsACString
    );

    xpcom_method!(
        complete_oauth_flow => CompleteOAuthFlow(
+7 −6
Original line number Diff line number Diff line
@@ -9,10 +9,8 @@ use crate::punt::{
use atomic_refcell::AtomicRefCell;
use fxa_client::{
    device::{
        Capability as FxaDeviceCapability,
        CommandFetchReason,
        PushSubscription as FxaPushSubscription,
        Type as FxaDeviceType,
        Capability as FxaDeviceCapability, CommandFetchReason,
        PushSubscription as FxaPushSubscription, Type as FxaDeviceType,
    },
    FirefoxAccount,
};
@@ -391,7 +389,8 @@ impl PuntTask {
            Punt::ToJson => fxa.to_json().map(PuntResult::String),
            Punt::BeginOAuthFlow(scopes, entry_point) => {
                let scopes: Vec<&str> = scopes.iter().map(AsRef::as_ref).collect();
                fxa.begin_oauth_flow(&scopes, &entry_point, None).map(PuntResult::String)
                fxa.begin_oauth_flow(&scopes, &entry_point, None)
                    .map(PuntResult::String)
            }
            Punt::CompleteOAuthFlow(code, state) => fxa
                .complete_oauth_flow(&code, &state)
@@ -451,7 +450,9 @@ impl PuntTask {
            Punt::HandlePushMessage(payload) => fxa
                .handle_push_message(&payload)
                .map(PuntResult::json_stringify),
            Punt::PollDeviceCommands => fxa.poll_device_commands(CommandFetchReason::Poll).map(PuntResult::json_stringify),
            Punt::PollDeviceCommands => fxa
                .poll_device_commands(CommandFetchReason::Poll)
                .map(PuntResult::json_stringify),
            Punt::SendSingleTab(target_id, title, url) => fxa
                .send_tab(&target_id, &title, &url)
                .map(|_| PuntResult::Null),
Loading