Import upstream v0.16.22, stripped

Upstream commit: 474dd0229cb20cf513036619781ed97bd8073c3f
Enterprise-only files removed or emptied: 63
Enterprise-only snippets removed: 117 in 50 files
Dangling module declarations removed: 5
Cargo edits turning enterprise off: 14
Verification: clean
Enterprise feature gates left for rebuilt features: 19 in 18 files

Produced by tools/fork/strip.py. The full report is in docs/fork/strip-reports/ on main.
This commit is contained in:
2026-09-18 10:21:56 -07:00
commit 7dae9b29fd
1650 changed files with 485521 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
/*
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*/
use crate::{
parser::{DavParser, Token, tokenizer::Tokenizer},
schema::{Element, NamedElement, Namespace, request::MkCol},
};
impl DavParser for MkCol {
fn parse(stream: &mut Tokenizer<'_>) -> crate::parser::Result<Self> {
let mut mkcol = MkCol {
is_mkcalendar: false,
props: Vec::new(),
};
match stream.token()? {
Token::ElementStart {
name:
NamedElement {
ns: Namespace::Dav,
element: Element::Mkcol,
},
..
} => {}
Token::ElementStart {
name:
NamedElement {
ns: Namespace::CalDav,
element: Element::Mkcalendar,
},
..
} => {
mkcol.is_mkcalendar = true;
}
Token::Eof => {
return Ok(mkcol);
}
other => return Err(other.into_unexpected()),
};
loop {
match stream.token()? {
Token::ElementStart {
name:
NamedElement {
ns: Namespace::Dav,
element: Element::Set,
},
..
} => {
stream.expect_named_element(NamedElement::dav(Element::Prop))?;
stream.collect_property_values(&mut mkcol.props)?;
stream.expect_element_end()?;
}
Token::ElementEnd | Token::Eof => {
break;
}
token => return Err(token.into_unexpected()),
}
}
Ok(mkcol)
}
}