diff options
author | cypherpunks <cypherpunks@torproject.org> | 2018-08-03 19:48:10 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-16 08:42:57 -0400 |
commit | 6b609ce4356423a28e7b421a9f09849d831a0c6f (patch) | |
tree | 0feff6aae6ea11f4933d47e96949539c32368e3d /src/rust/protover/ffi.rs | |
parent | 32ad8e991999277948e896196731f2919c390f00 (diff) | |
download | tor-6b609ce4356423a28e7b421a9f09849d831a0c6f.tar.gz tor-6b609ce4356423a28e7b421a9f09849d831a0c6f.zip |
rust: run rustfmt
Diffstat (limited to 'src/rust/protover/ffi.rs')
-rw-r--r-- | src/rust/protover/ffi.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs index 91bd83addf..0c28d032c6 100644 --- a/src/rust/protover/ffi.rs +++ b/src/rust/protover/ffi.rs @@ -62,8 +62,7 @@ pub extern "C" fn protover_all_supported( }; if let Some(unsupported) = relay_proto_entry.all_supported() { - let c_unsupported: CString = match CString::new(unsupported.to_string()) - { + let c_unsupported: CString = match CString::new(unsupported.to_string()) { Ok(n) => n, Err(_) => return 1, }; @@ -113,9 +112,7 @@ pub extern "C" fn protocol_list_supports_protocol( } #[no_mangle] -pub extern "C" fn protover_contains_long_protocol_names_( - c_protocol_list: *const c_char, -) -> c_int { +pub extern "C" fn protover_contains_long_protocol_names_(c_protocol_list: *const c_char) -> c_int { if c_protocol_list.is_null() { return 1; } @@ -216,8 +213,7 @@ pub extern "C" fn protover_compute_vote( }; proto_entries.push(entry); } - let vote: UnvalidatedProtoEntry = - ProtoverVote::compute(&proto_entries, &hold); + let vote: UnvalidatedProtoEntry = ProtoverVote::compute(&proto_entries, &hold); allocate_and_copy_string(&vote.to_string()) } @@ -225,10 +221,7 @@ pub extern "C" fn protover_compute_vote( /// Provide an interface for C to translate arguments and return types for /// protover::is_supported_here #[no_mangle] -pub extern "C" fn protover_is_supported_here( - c_protocol: uint32_t, - version: uint32_t, -) -> c_int { +pub extern "C" fn protover_is_supported_here(c_protocol: uint32_t, version: uint32_t) -> c_int { let protocol = match translate_to_rust(c_protocol) { Ok(n) => n, Err(_) => return 0, @@ -242,9 +235,7 @@ pub extern "C" fn protover_is_supported_here( /// Provide an interface for C to translate arguments and return types for /// protover::compute_for_old_tor #[no_mangle] -pub extern "C" fn protover_compute_for_old_tor( - version: *const c_char, -) -> *const c_char { +pub extern "C" fn protover_compute_for_old_tor(version: *const c_char) -> *const c_char { let supported: &'static CStr; let empty: &'static CStr; |