Skip to content

Commit

Permalink
Pass VecDeque
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Jan 22, 2024
1 parent d859022 commit ad02584
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions neqo-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ fn handle_test(
local_addr: SocketAddr,
remote_addr: SocketAddr,
hostname: &str,
urls: Vec<Url>,
url_queue: VecDeque<Url>,
resumption_token: Option<ResumptionToken>,
) -> Res<Option<ResumptionToken>> {
let key_update = KeyUpdateState(args.key_update);
Expand All @@ -843,7 +843,7 @@ fn handle_test(
.expect("failed to create client");
args.method = String::from("POST");
let url_handler = URLHandler {
url_queue: VecDeque::from(urls.to_vec()),
url_queue,
stream_handlers: HashMap::new(),
all_paths: Vec::new(),
handler_type: StreamHandlerType::Upload,
Expand Down Expand Up @@ -912,7 +912,7 @@ fn client(
local_addr: SocketAddr,
remote_addr: SocketAddr,
hostname: &str,
urls: Vec<Url>,
url_queue: VecDeque<Url>,
resumption_token: Option<ResumptionToken>,
) -> Res<Option<ResumptionToken>> {
let testcase = args.test.clone();
Expand All @@ -925,7 +925,7 @@ fn client(
local_addr,
remote_addr,
hostname,
urls,
url_queue,
resumption_token,
);
}
Expand All @@ -934,7 +934,7 @@ fn client(
.expect("failed to create client");
let key_update = KeyUpdateState(args.key_update);
let url_handler = URLHandler {
url_queue: VecDeque::from(urls.to_vec()),
url_queue,
stream_handlers: HashMap::new(),
all_paths: Vec::new(),
handler_type: StreamHandlerType::Download,
Expand Down Expand Up @@ -1087,9 +1087,9 @@ fn main() -> Res<()> {
);
exit(127);
}
urls.pop_front().map_or(vec![], |u| vec![u])
urls.pop_front().into_iter().collect()
} else {
urls.drain(..).collect()
std::mem::take(&mut urls)
};
if to_request.is_empty() {
break;
Expand Down Expand Up @@ -1417,7 +1417,7 @@ mod old {
local_addr: SocketAddr,
remote_addr: SocketAddr,
origin: &str,
urls: Vec<Url>,
url_queue: VecDeque<Url>,
token: Option<ResumptionToken>,
) -> Res<Option<ResumptionToken>> {
let alpn = match args.alpn.as_str() {
Expand Down Expand Up @@ -1449,7 +1449,7 @@ mod old {
let key_update = KeyUpdateState(args.key_update);
let mut h = HandlerOld {
streams: HashMap::new(),
url_queue: VecDeque::from(urls.to_vec()),
url_queue,
all_paths: Vec::new(),
args,
token: None,
Expand Down

0 comments on commit ad02584

Please sign in to comment.