Upgrade yap from 0.11 to 0.12

This commit is contained in:
Jonas Platte 2024-04-28 22:06:27 +02:00
parent 19a29934fa
commit 7a89ab392c
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@ rustdoc-args = ["--cfg", "docsrs"]
headers = "0.4.0"
ruma-common = { workspace = true }
tracing = { workspace = true }
yap = "0.11.0"
yap = "0.12.0"
[dev-dependencies]
tracing-subscriber = "0.3.16"

View File

@ -41,7 +41,7 @@ impl XMatrix {
fn parse_token<'a>(tokens: &mut impl Tokens<Item = &'a u8>) -> Option<Vec<u8>> {
tokens.optional(|t| {
let token: Vec<u8> = t.tokens_while(|c| is_tchar(**c)).copied().collect();
let token: Vec<u8> = t.take_while(|c| is_tchar(**c)).as_iter().copied().collect();
if !token.is_empty() {
Some(token)
} else {
@ -53,7 +53,8 @@ fn parse_token<'a>(tokens: &mut impl Tokens<Item = &'a u8>) -> Option<Vec<u8>> {
fn parse_token_with_colons<'a>(tokens: &mut impl Tokens<Item = &'a u8>) -> Option<Vec<u8>> {
tokens.optional(|t| {
let token: Vec<u8> = t.tokens_while(|c| is_tchar(**c) || **c == b':').copied().collect();
let token: Vec<u8> =
t.take_while(|c| is_tchar(**c) || **c == b':').as_iter().copied().collect();
if !token.is_empty() {
Some(token)
} else {
@ -144,7 +145,7 @@ fn parse_xmatrix<'a>(tokens: &mut impl Tokens<Item = &'a u8>) -> Option<XMatrix>
let mut key = None;
let mut sig = None;
for (name, value) in t.sep_by(|t| parse_xmatrix_field(t), |t| t.token(&b',')) {
for (name, value) in t.sep_by(|t| parse_xmatrix_field(t), |t| t.token(&b',')).as_iter() {
match name.as_str() {
"origin" => {
if origin.is_some() {