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

Updated with rustfmt 1.4.18-stable (8157a3f 2020-07-15)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D106921
This commit is contained in:
Sylvestre Ledru 2021-03-02 15:35:36 +00:00
parent 7563ded7df
commit dd5945e932
3 changed files with 74 additions and 73 deletions

View File

@ -1238,10 +1238,7 @@ extern "C" {
fn wr_compositor_end_frame(compositor: *mut c_void);
fn wr_compositor_enable_native_compositor(compositor: *mut c_void, enable: bool);
fn wr_compositor_deinit(compositor: *mut c_void);
fn wr_compositor_get_capabilities(
compositor: *mut c_void,
caps: *mut CompositorCapabilities,
);
fn wr_compositor_get_capabilities(compositor: *mut c_void, caps: *mut CompositorCapabilities);
fn wr_compositor_map_tile(
compositor: *mut c_void,
id: NativeTileId,

View File

@ -206,7 +206,7 @@ pub extern "C" fn neqo_http3conn_process_input(
remote_addr: &nsACString,
packet: *const ThinVec<u8>,
) -> nsresult {
let remote = match str::from_utf8(remote_addr) {
let remote = match str::from_utf8(remote_addr) {
Ok(s) => match s.parse() {
Ok(addr) => addr,
Err(_) => return NS_ERROR_INVALID_ARG,
@ -265,7 +265,7 @@ pub extern "C" fn neqo_http3conn_get_data_to_send(
Some(d) => {
packet.extend_from_slice(&d);
remote_addr.append(&d.destination().ip().to_string());
*remote_port = d.destination().port();
*remote_port = d.destination().port();
NS_OK
}
}

View File

@ -102,77 +102,81 @@ impl ManagerProxy {
let (proxy_sender, manager_receiver) = channel();
let (manager_sender, proxy_receiver) = channel();
let thread_handle = thread::Builder::new()
.name("osclientcert".into())
.spawn(move || {
let mut real_manager = Manager::new();
loop {
let arguments = match manager_receiver.recv() {
Ok(arguments) => arguments,
Err(e) => {
error!("error recv()ing arguments from ManagerProxy: {}", e);
break;
.name("osclientcert".into())
.spawn(move || {
let mut real_manager = Manager::new();
loop {
let arguments = match manager_receiver.recv() {
Ok(arguments) => arguments,
Err(e) => {
error!("error recv()ing arguments from ManagerProxy: {}", e);
break;
}
};
let results = match arguments {
ManagerArguments::OpenSession(slot_type) => {
ManagerReturnValue::OpenSession(real_manager.open_session(slot_type))
}
ManagerArguments::CloseSession(session_handle) => {
ManagerReturnValue::CloseSession(
real_manager.close_session(session_handle),
)
}
ManagerArguments::CloseAllSessions(slot_type) => {
ManagerReturnValue::CloseAllSessions(
real_manager.close_all_sessions(slot_type),
)
}
ManagerArguments::StartSearch(session, attrs) => {
ManagerReturnValue::StartSearch(
real_manager.start_search(session, &attrs),
)
}
ManagerArguments::Search(session, max_objects) => {
ManagerReturnValue::Search(real_manager.search(session, max_objects))
}
ManagerArguments::ClearSearch(session) => {
ManagerReturnValue::ClearSearch(real_manager.clear_search(session))
}
ManagerArguments::GetAttributes(object_handle, attr_types) => {
ManagerReturnValue::GetAttributes(
real_manager.get_attributes(object_handle, attr_types),
)
}
ManagerArguments::StartSign(session, key_handle, params) => {
ManagerReturnValue::StartSign(
real_manager.start_sign(session, key_handle, params),
)
}
ManagerArguments::GetSignatureLength(session, data) => {
ManagerReturnValue::GetSignatureLength(
real_manager.get_signature_length(session, &data),
)
}
ManagerArguments::Sign(session, data) => {
ManagerReturnValue::Sign(real_manager.sign(session, &data))
}
ManagerArguments::Stop => {
debug!("ManagerArguments::Stop received - stopping Manager thread.");
ManagerReturnValue::Stop(Ok(()))
}
};
let stop_after_send = match &results {
&ManagerReturnValue::Stop(_) => true,
_ => false,
};
match manager_sender.send(results) {
Ok(()) => {}
Err(e) => {
error!("error send()ing results from Manager: {}", e);
break;
}
}
};
let results = match arguments {
ManagerArguments::OpenSession(slot_type) => {
ManagerReturnValue::OpenSession(real_manager.open_session(slot_type))
}
ManagerArguments::CloseSession(session_handle) => {
ManagerReturnValue::CloseSession(real_manager.close_session(session_handle))
}
ManagerArguments::CloseAllSessions(slot_type) => {
ManagerReturnValue::CloseAllSessions(
real_manager.close_all_sessions(slot_type),
)
}
ManagerArguments::StartSearch(session, attrs) => {
ManagerReturnValue::StartSearch(real_manager.start_search(session, &attrs))
}
ManagerArguments::Search(session, max_objects) => {
ManagerReturnValue::Search(real_manager.search(session, max_objects))
}
ManagerArguments::ClearSearch(session) => {
ManagerReturnValue::ClearSearch(real_manager.clear_search(session))
}
ManagerArguments::GetAttributes(object_handle, attr_types) => {
ManagerReturnValue::GetAttributes(
real_manager.get_attributes(object_handle, attr_types),
)
}
ManagerArguments::StartSign(session, key_handle, params) => {
ManagerReturnValue::StartSign(
real_manager.start_sign(session, key_handle, params),
)
}
ManagerArguments::GetSignatureLength(session, data) => {
ManagerReturnValue::GetSignatureLength(
real_manager.get_signature_length(session, &data),
)
}
ManagerArguments::Sign(session, data) => {
ManagerReturnValue::Sign(real_manager.sign(session, &data))
}
ManagerArguments::Stop => {
debug!("ManagerArguments::Stop received - stopping Manager thread.");
ManagerReturnValue::Stop(Ok(()))
}
};
let stop_after_send = match &results {
&ManagerReturnValue::Stop(_) => true,
_ => false,
};
match manager_sender.send(results) {
Ok(()) => {}
Err(e) => {
error!("error send()ing results from Manager: {}", e);
if stop_after_send {
break;
}
}
if stop_after_send {
break;
}
}
});
});
match thread_handle {
Ok(thread_handle) => Ok(ManagerProxy {
sender: proxy_sender,