File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
### New Features
14
14
15
+ - [ #758 ] : Implemented ` From<QName> ` for ` BytesStart ` and ` BytesEnd ` .
16
+
15
17
### Bug Fixes
16
18
17
19
- [ #755 ] : Fix incorrect missing of trimming all-space text events when
23
25
24
26
[ #650 ] : https://github.com/tafia/quick-xml/issues/650
25
27
[ #755 ] : https://github.com/tafia/quick-xml/pull/755
28
+ [ #758 ] : https://github.com/tafia/quick-xml/pull/758
26
29
27
30
28
31
## 0.32.0 -- 2024-06-10
Original file line number Diff line number Diff line change @@ -163,8 +163,9 @@ impl<'a> BytesStart<'a> {
163
163
}
164
164
165
165
/// Creates new paired close tag
166
+ #[ inline]
166
167
pub fn to_end ( & self ) -> BytesEnd {
167
- BytesEnd :: wrap ( self . name ( ) . into_inner ( ) . into ( ) )
168
+ BytesEnd :: from ( self . name ( ) )
168
169
}
169
170
170
171
/// Gets the undecoded raw tag name, as present in the input stream.
@@ -322,6 +323,14 @@ impl<'a> Deref for BytesStart<'a> {
322
323
}
323
324
}
324
325
326
+ impl < ' a > From < QName < ' a > > for BytesStart < ' a > {
327
+ #[ inline]
328
+ fn from ( name : QName < ' a > ) -> Self {
329
+ let name = name. into_inner ( ) ;
330
+ Self :: wrap ( name, name. len ( ) )
331
+ }
332
+ }
333
+
325
334
#[ cfg( feature = "arbitrary" ) ]
326
335
impl < ' a > arbitrary:: Arbitrary < ' a > for BytesStart < ' a > {
327
336
fn arbitrary ( u : & mut arbitrary:: Unstructured < ' a > ) -> arbitrary:: Result < Self > {
@@ -673,6 +682,13 @@ impl<'a> Deref for BytesEnd<'a> {
673
682
}
674
683
}
675
684
685
+ impl < ' a > From < QName < ' a > > for BytesEnd < ' a > {
686
+ #[ inline]
687
+ fn from ( name : QName < ' a > ) -> Self {
688
+ Self :: wrap ( name. into_inner ( ) . into ( ) )
689
+ }
690
+ }
691
+
676
692
#[ cfg( feature = "arbitrary" ) ]
677
693
impl < ' a > arbitrary:: Arbitrary < ' a > for BytesEnd < ' a > {
678
694
fn arbitrary ( u : & mut arbitrary:: Unstructured < ' a > ) -> arbitrary:: Result < Self > {
You can’t perform that action at this time.
0 commit comments