[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.3.5] Merge remote-tracking branch 'nickm/bug27741_033' into bug27741_035



commit 7bf9c93ab3af5be6f0881d4bc21fd8d72becff96
Merge: 1ae911660 80ad15921
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Tue Sep 18 23:32:57 2018 +1000

    Merge remote-tracking branch 'nickm/bug27741_033' into bug27741_035
    
    Resolve conflicts due to rustfmt, and run rustfmt on the merged code.

 changes/bug27741         |  5 +++++
 src/rust/protover/ffi.rs | 19 ++++---------------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --cc src/rust/protover/ffi.rs
index 0c28d032c,f803bd015..940f92332
--- a/src/rust/protover/ffi.rs
+++ b/src/rust/protover/ffi.rs
@@@ -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
@@@ -200,16 -222,9 +196,9 @@@
      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);
      }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits