cargo fmt

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-04-21 17:33:56 +02:00
parent 1e02dd2d1f
commit 1987b44315

View file

@ -35,7 +35,7 @@
//! # mode to ensure that it only matches a completely empty message stanza: //! # mode to ensure that it only matches a completely empty message stanza:
//! //!
//! Louise receives: //! Louise receives:
//! <message scansion:strict="true"/> //! <message scansion:strict="true"/>
//! ``` //! ```
use std::fmt::Debug; use std::fmt::Debug;
@ -401,13 +401,13 @@ mod tests {
assert_eq!(scan1, &elem1); assert_eq!(scan1, &elem1);
let elem2: Element = "<presence scansion:strict='true' xmlns='jabber:client'> let elem2: Element = "<presence scansion:strict='true' xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc'/> <x xmlns='http://jabber.org/protocol/muc'/>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let elem3: Element = "<presence xmlns='jabber:client'> let elem3: Element = "<presence xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc'/> <x xmlns='http://jabber.org/protocol/muc'/>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let scan2 = ScanElement::new(elem2); let scan2 = ScanElement::new(elem2);
@ -427,20 +427,20 @@ mod tests {
#[test] #[test]
fn compare_element_strict_nodes_success() { fn compare_element_strict_nodes_success() {
let elem1: Element = "<presence scansion:strict='true' xmlns='jabber:client'> let elem1: Element = "<presence scansion:strict='true' xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc' /> <x xmlns='http://jabber.org/protocol/muc' />
<x xmlns='vcard-temp:x:update'> <x xmlns='vcard-temp:x:update'>
<photo/> <photo/>
</x> </x>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
// The same, minus 'scansion:strict' // The same, minus 'scansion:strict'
let elem2: Element = "<presence xmlns='jabber:client'> let elem2: Element = "<presence xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc' /> <x xmlns='http://jabber.org/protocol/muc' />
<x xmlns='vcard-temp:x:update'> <x xmlns='vcard-temp:x:update'>
<photo/> <photo/>
</x> </x>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let scan1 = ScanElement::new(elem1); let scan1 = ScanElement::new(elem1);
@ -451,17 +451,17 @@ mod tests {
#[test] #[test]
fn compare_element_strict_nodes_failure() { fn compare_element_strict_nodes_failure() {
let elem1: Element = "<presence scansion:strict='true' xmlns='jabber:client'> let elem1: Element = "<presence scansion:strict='true' xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc' /> <x xmlns='http://jabber.org/protocol/muc' />
<x xmlns='vcard-temp:x:update'> <x xmlns='vcard-temp:x:update'>
<photo/> <photo/>
</x> </x>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let elem2: Element = "<presence scansion:strict='true' xmlns='jabber:client'> let elem2: Element = "<presence scansion:strict='true' xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc' /> <x xmlns='http://jabber.org/protocol/muc' />
<x xmlns='vcard-temp:x:update'/> <x xmlns='vcard-temp:x:update'/>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let scan1 = ScanElement::new(elem1); let scan1 = ScanElement::new(elem1);
@ -479,13 +479,13 @@ mod tests {
assert_eq!(scan1, &elem1); assert_eq!(scan1, &elem1);
let elem2: Element = "<presence xmlns='jabber:client'> let elem2: Element = "<presence xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc' scansion:strict='false' /> <x xmlns='http://jabber.org/protocol/muc' scansion:strict='false' />
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let elem3: Element = "<presence xmlns='jabber:client' foo='bar'> let elem3: Element = "<presence xmlns='jabber:client' foo='bar'>
<x xmlns='http://jabber.org/protocol/muc' baz='qxx' /> <x xmlns='http://jabber.org/protocol/muc' baz='qxx' />
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let scan2 = ScanElement::new(elem2); let scan2 = ScanElement::new(elem2);
@ -504,13 +504,13 @@ mod tests {
assert_ne!(scan1, &elem2); assert_ne!(scan1, &elem2);
let elem2: Element = "<presence xmlns='jabber:client' foo='bar'> let elem2: Element = "<presence xmlns='jabber:client' foo='bar'>
<x xmlns='http://jabber.org/protocol/muc'/> <x xmlns='http://jabber.org/protocol/muc'/>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let elem3: Element = "<presence xmlns='jabber:client'> let elem3: Element = "<presence xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc'/> <x xmlns='http://jabber.org/protocol/muc'/>
</presence>" </presence>"
.parse() .parse()
.unwrap(); .unwrap();
let scan2 = ScanElement::new(elem2); let scan2 = ScanElement::new(elem2);
@ -541,13 +541,13 @@ mod tests {
#[test] #[test]
fn compare_element_non_strict_elem_failure() { fn compare_element_non_strict_elem_failure() {
let elem2: Element = "<message scansion:strict='false' xmlns='jabber:client'> let elem2: Element = "<message scansion:strict='false' xmlns='jabber:client'>
<body>foo</body> <body>foo</body>
</message>" </message>"
.parse() .parse()
.unwrap(); .unwrap();
let elem3: Element = "<message xmlns='jabber:client'> let elem3: Element = "<message xmlns='jabber:client'>
<body>bar</body> <body>bar</body>
</message>" </message>"
.parse() .parse()
.unwrap(); .unwrap();
let scan2 = ScanElement::new(elem2); let scan2 = ScanElement::new(elem2);
@ -558,13 +558,13 @@ mod tests {
#[test] #[test]
fn compare_element_propagate_strictness() { fn compare_element_propagate_strictness() {
let elem1: Element = "<message scansion:strict='true' xmlns='jabber:client'> let elem1: Element = "<message scansion:strict='true' xmlns='jabber:client'>
<foo><bar /></foo> <foo><bar /></foo>
</message>" </message>"
.parse() .parse()
.unwrap(); .unwrap();
let elem2: Element = "<message scansion:strict='true' xmlns='jabber:client'> let elem2: Element = "<message scansion:strict='true' xmlns='jabber:client'>
<foo><bar baz='qxx' /></foo> <foo><bar baz='qxx' /></foo>
</message>" </message>"
.parse() .parse()
.unwrap(); .unwrap();
let scan1 = ScanElement::new(elem1); let scan1 = ScanElement::new(elem1);