Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
cb3c18c1c6
commit
f3b47b157d
1 changed files with 4 additions and 4 deletions
|
@ -40,8 +40,8 @@ impl<'a> From<NomErr<nom::error::Error<LocatedSpan<&'a str>>>> for Token<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static DEFAULT_NS: &'static str = "jabber:client";
|
pub static DEFAULT_NS: &str = "jabber:client";
|
||||||
pub static SCANSION_NS: &'static str = "https://matthewwild.co.uk/projects/scansion";
|
pub static SCANSION_NS: &str = "https://matthewwild.co.uk/projects/scansion";
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct Metadata {
|
pub struct Metadata {
|
||||||
|
@ -116,6 +116,7 @@ fn allspaces(s: Span) -> IResult<Span, Token> {
|
||||||
let (s, (pos, _, comments)) = tuple((position, multispace0, opt(comment)))(s)?;
|
let (s, (pos, _, comments)) = tuple((position, multispace0, opt(comment)))(s)?;
|
||||||
|
|
||||||
let mut s = s;
|
let mut s = s;
|
||||||
|
#[allow(clippy::redundant_pattern_matching)]
|
||||||
if let Some(_) = comments {
|
if let Some(_) = comments {
|
||||||
let (j, _) = multispace0(s)?;
|
let (j, _) = multispace0(s)?;
|
||||||
s = j;
|
s = j;
|
||||||
|
@ -312,8 +313,7 @@ fn parse_send_receive<'a>(tagname: &str, name: String, s: Span<'a>) -> IResult<S
|
||||||
let mut prefixes = BTreeMap::new();
|
let mut prefixes = BTreeMap::new();
|
||||||
prefixes.insert(None, String::from(DEFAULT_NS));
|
prefixes.insert(None, String::from(DEFAULT_NS));
|
||||||
prefixes.insert(Some(String::from("scansion")), String::from(SCANSION_NS));
|
prefixes.insert(Some(String::from("scansion")), String::from(SCANSION_NS));
|
||||||
let elem: Element =
|
let elem: Element = Element::from_reader_with_prefixes(lines.as_bytes(), prefixes).unwrap();
|
||||||
Element::from_reader_with_prefixes(&lines.as_bytes()[..], prefixes).unwrap();
|
|
||||||
Ok(match tagname {
|
Ok(match tagname {
|
||||||
"sends:" => (s, Action::Send(name, elem)),
|
"sends:" => (s, Action::Send(name, elem)),
|
||||||
"receives:" => (s, Action::Receive(name, elem)),
|
"receives:" => (s, Action::Receive(name, elem)),
|
||||||
|
|
Loading…
Reference in a new issue