Skip to content

Commit

Permalink
No need for single-element vec for chaining one element
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 3, 2023
1 parent 6a9a21f commit 015e397
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test_suite/tests/test_de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::default::Default;
use std::ffi::{CStr, CString, OsString};
use std::fmt::Debug;
use std::iter;
use std::net;
use std::num::{
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128,
Expand Down Expand Up @@ -199,7 +200,7 @@ fn assert_de_tokens_ignore(ignorable_tokens: &[Token]) {
]
.into_iter()
.chain(ignorable_tokens.iter().copied())
.chain(vec![Token::MapEnd])
.chain(iter::once(Token::MapEnd))
.collect();

let expected = IgnoreBase { a: 1 };
Expand Down

0 comments on commit 015e397

Please sign in to comment.