]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'nickm/bug27741_033' into bug27741_035
authorteor <teor@torproject.org>
Tue, 18 Sep 2018 13:32:57 +0000 (23:32 +1000)
committerteor <teor@torproject.org>
Tue, 18 Sep 2018 13:32:57 +0000 (23:32 +1000)
Resolve conflicts due to rustfmt, and run rustfmt on the merged code.

1  2 
src/rust/protover/ffi.rs

index 0c28d032c65b416374271b0740ff357a84b97a13,f803bd01558bc5e0da898a18e2ecc014ba48127a..940f92332744ca8ecb1ccb0a5c757994107821b3
@@@ -184,13 -205,14 +184,9 @@@ pub extern "C" fn protover_get_supporte
  //
  // 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,
 -    threshold: c_int
--) -> *mut c_char {
 -
++pub extern "C" fn protover_compute_vote(list: *const Stringlist, threshold: c_int) -> *mut c_char {
      if list.is_null() {
 -        let empty = String::new();
 -        return allocate_and_copy_string(&empty);
 +        return allocate_and_copy_string("");
      }
  
      // Dereference of raw pointer requires an unsafe block. The pointer is
      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
++            Ok(n) => n,
++            Err(_) => continue,
          };
          proto_entries.push(entry);
      }