1
0
Fork 0
forked from wry/wry

autocommit 2022-02-09 17:26:50 CET

This commit is contained in:
Julian Orth 2022-02-09 17:26:50 +01:00
parent 4190b910f8
commit 8faab3fe53
25 changed files with 1081 additions and 316 deletions

View file

@ -36,6 +36,13 @@ impl<'a> MsgFormatter<'a> {
self
}
pub fn optstr<S: AsRef<[u8]> + ?Sized>(&mut self, s: Option<&S>) -> &mut Self {
match s {
Some(s) => self.string(s),
_ => self.uint(0),
}
}
pub fn string<S: AsRef<[u8]> + ?Sized>(&mut self, s: &S) -> &mut Self {
let s = s.as_ref();
let len = s.len() + 1;