aboutsummaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2018-09-18 23:32:57 +1000
committerteor <teor@torproject.org>2018-09-18 23:32:57 +1000
commit7bf9c93ab3af5be6f0881d4bc21fd8d72becff96 (patch)
treed2c4c6e885670bd8a16a03437c434cebd46ca1d5 /src/rust
parent1ae91166016ec70a242c6dbb14c9ca5e77b1313f (diff)
parent80ad15921cef42ac12da356584f217d2ead5cb09 (diff)
downloadtor-7bf9c93ab3af5be6f0881d4bc21fd8d72becff96.tar.gz
tor-7bf9c93ab3af5be6f0881d4bc21fd8d72becff96.zip
Merge remote-tracking branch 'nickm/bug27741_033' into bug27741_035
Resolve conflicts due to rustfmt, and run rustfmt on the merged code.
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/protover/ffi.rs19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs
index 0c28d032c6..940f923327 100644
--- a/src/rust/protover/ffi.rs
+++ b/src/rust/protover/ffi.rs
@@ -184,11 +184,7 @@ pub extern "C" fn protover_get_supported_protocols() -> *const c_char {
//
// Why is the threshold a signed integer? —isis
#[no_mangle]
-pub extern "C" fn protover_compute_vote(
- list: *const Stringlist,
- threshold: c_int,
- allow_long_proto_names: bool,
-) -> *mut c_char {
+pub extern "C" fn protover_compute_vote(list: *const Stringlist, threshold: c_int) -> *mut c_char {
if list.is_null() {
return allocate_and_copy_string("");
}
@@ -200,16 +196,9 @@ pub extern "C" fn protover_compute_vote(
let mut proto_entries: Vec<UnvalidatedProtoEntry> = Vec::new();
for datum in data {
- let entry: UnvalidatedProtoEntry = if allow_long_proto_names {
- match UnvalidatedProtoEntry::from_str_any_len(datum.as_str()) {
- Ok(n) => n,
- Err(_) => continue,
- }
- } else {
- match datum.parse() {
- Ok(n) => n,
- Err(_) => continue,
- }
+ let entry: UnvalidatedProtoEntry = match datum.parse() {
+ Ok(n) => n,
+ Err(_) => continue,
};
proto_entries.push(entry);
}