mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
[rust] Avoid a clone in contract_protocol_list()
This commit is contained in:
parent
12f58b42a8
commit
69502942b0
1 changed files with 3 additions and 2 deletions
|
@ -429,8 +429,9 @@ fn find_range(list: &Vec<u32>) -> (bool, u32) {
|
|||
/// A `String` representation of this set in ascending order.
|
||||
///
|
||||
fn contract_protocol_list<'a>(supported_set: &'a HashSet<u32>) -> String {
|
||||
let mut supported_clone = supported_set.clone();
|
||||
let mut supported: Vec<u32> = supported_clone.drain().collect();
|
||||
let mut supported: Vec<u32> = supported_set.iter()
|
||||
.map(|x| *x)
|
||||
.collect();
|
||||
supported.sort();
|
||||
|
||||
let mut final_output: Vec<String> = Vec::new();
|
||||
|
|
Loading…
Add table
Reference in a new issue