Skip to content

Commit 3cd0fb3

Browse files
committed
address review comments
1 parent d1d7d70 commit 3cd0fb3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/codegen/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ use quote::TokenStreamExt;
5151
use crate::{Entry, HashMap, HashSet};
5252
use std::borrow::Cow;
5353
use std::cell::Cell;
54+
use std::collections::BTreeMap;
5455
use std::collections::VecDeque;
5556
use std::fmt::Write;
5657
use std::iter;
@@ -246,7 +247,7 @@ struct CodegenResult<'a> {
246247
/// that name. This lets us give each overload a unique suffix.
247248
overload_counters: HashMap<String, u32>,
248249

249-
variadic_methods: HashMap<Ident, VariadicMethodInfo>,
250+
variadic_methods: BTreeMap<Ident, VariadicMethodInfo>,
250251
}
251252

252253
impl<'a> CodegenResult<'a> {
@@ -2513,7 +2514,7 @@ impl MethodCodegen for Method {
25132514
let mut ret = utils::fnsig_return_ty(ctx, signature);
25142515
let is_variadic = signature.is_variadic();
25152516

2516-
if is_variadic & ctx.options().tuple_varargs_len.is_none() {
2517+
if is_variadic && ctx.options().tuple_varargs_len.is_none() {
25172518
return;
25182519
}
25192520

@@ -5082,9 +5083,8 @@ pub mod utils {
50825083
// This will hold the methods to be declared in the `VarArgs` trait as well as the
50835084
// bodies of the implementations of such methods for each tuple length.
50845085
let (trait_method_decls, trait_method_impl_fns): (Vec<_>, Vec<_>) =
5085-
result
5086-
.variadic_methods
5087-
.drain()
5086+
std::mem::take(&mut result.variadic_methods)
5087+
.into_iter()
50885088
.map(|(name, info)| {
50895089
let super::VariadicMethodInfo { args, ret, exprs } = info;
50905090

0 commit comments

Comments
 (0)