ddex-parser 0.4.5

High-performance DDEX XML parser with SIMD optimization (40+ MB/s)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-builder/bindings/node/Cargo.toml
workspace: /Users/kevinmoo/Desktop/localrepo/ddex-suite/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-builder/bindings/wasm/Cargo.toml
workspace: /Users/kevinmoo/Desktop/localrepo/ddex-suite/Cargo.toml
   Compiling ddex-parser v0.4.0 (/Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-parser)
    Checking ddex-core v0.4.0 (/Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/core)
warning: ddex-parser@0.4.0: Generating TypeScript definitions...
warning: unused import: `WorkingStreamingElement`
 --> packages/ddex-parser/src/streaming/perf_analysis.rs:4:61
  |
4 | use crate::streaming::working_impl::{WorkingStreamIterator, WorkingStreamingElement};
  |                                                             ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `WorkingStreamingStats`
 --> packages/ddex-parser/src/streaming/zero_copy_benchmark.rs:9:47
  |
9 | use crate::streaming::{WorkingStreamIterator, WorkingStreamingStats};
  |                                               ^^^^^^^^^^^^^^^^^^^^^

warning: redundant field names in struct initialization
   --> packages/ddex-parser/src/streaming/zero_copy_benchmark.rs:199:13
    |
199 |             current_elements: current_elements,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_elements`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> packages/ddex-parser/src/streaming/zero_copy_benchmark.rs:200:13
    |
200 |             zero_copy_elements: zero_copy_elements,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `zero_copy_elements`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: unused import: `ERNVersion`
 --> packages/ddex-parser/src/api_integration_test.rs:6:29
  |
6 |     use crate::{DDEXParser, ERNVersion};
  |                             ^^^^^^^^^^

warning: variant `Complete` is never constructed
  --> packages/ddex-parser/src/streaming/aligned_comprehensive.rs:33:5
   |
27 | enum AlignedParserState {
   |      ------------------ variant in this enum
...
33 |     Complete,
   |     ^^^^^^^^
   |
   = note: `AlignedParserState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: method `get_current_location` is never used
   --> packages/ddex-parser/src/streaming/aligned_comprehensive.rs:388:8
    |
50  | impl<R: BufRead> AlignedStreamingParser<R> {
    | ------------------------------------------ method in this implementation
...
388 |     fn get_current_location(&self) -> ErrorLocation {
    |        ^^^^^^^^^^^^^^^^^^^^

warning: variant `Complete` is never constructed
  --> packages/ddex-parser/src/streaming/comprehensive.rs:32:5
   |
26 | enum ParserState {
   |      ----------- variant in this enum
...
32 |     Complete,
   |     ^^^^^^^^
   |
   = note: `ParserState` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis

warning: field `config` is never read
  --> packages/ddex-parser/src/streaming/fast_streaming_parser.rs:14:5
   |
13 | pub struct FastStreamingParser {
   |            ------------------- field in this struct
14 |     config: StreamingConfig,
   |     ^^^^^^

warning: fields `reader` and `buffer` are never read
  --> packages/ddex-parser/src/streaming/fixed_comprehensive.rs:27:5
   |
26 | pub struct FixedStreamingParser<R: BufRead> {
   |            -------------------- fields in this struct
27 |     reader: Reader<R>,
   |     ^^^^^^
28 |     buffer: Vec<u8>,
   |     ^^^^^^

warning: method `get_location` is never used
   --> packages/ddex-parser/src/streaming/minimal.rs:129:8
    |
40  | impl<R: BufRead> MinimalStreamingParser<R> {
    | ------------------------------------------ method in this implementation
...
129 |     fn get_location(&self) -> ErrorLocation {
    |        ^^^^^^^^^^^^

warning: methods `find_element_boundaries` and `find_pattern` are never used
   --> packages/ddex-parser/src/streaming/parallel_parser.rs:84:8
    |
25  | impl ParallelStreamingParser {
    | ---------------------------- methods in this implementation
...
84  |     fn find_element_boundaries(&self, data: &[u8]) -> Vec<usize> {
    |        ^^^^^^^^^^^^^^^^^^^^^^^
...
131 |     fn find_pattern(&self, data: &[u8], pattern: &[u8]) -> Option<usize> {
    |        ^^^^^^^^^^^^

warning: field `reader` is never read
   --> packages/ddex-parser/src/streaming/parallel_parser.rs:185:5
    |
184 | pub struct ParallelStreamingIterator<R: BufRead> {
    |            ------------------------- field in this struct
185 |     reader: R,
    |     ^^^^^^

warning: multiple methods are never used
   --> packages/ddex-parser/src/streaming/parser.rs:136:8
    |
30  | impl<R: BufRead> StreamingDDEXParser<R> {
    | --------------------------------------- methods in this implementation
...
136 |     fn handle_start_element(
    |        ^^^^^^^^^^^^^^^^^^^^
...
218 |     fn handle_nested_start_element(&mut self, name: &str) -> Result<(), ParseError> {
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
273 |     fn handle_end_element(
    |        ^^^^^^^^^^^^^^^^^^
...
331 |     fn handle_header_end_element(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^
...
385 |     fn handle_release_end_element(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
...
427 |     fn handle_resource_end_element(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
465 |     fn handle_party_end_element(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^
...
477 |     fn handle_deal_end_element(
    |        ^^^^^^^^^^^^^^^^^^^^^^^
...
542 |     fn get_current_location(&self) -> ErrorLocation {
    |        ^^^^^^^^^^^^^^^^^^^^

warning: field `state` is never read
  --> packages/ddex-parser/src/streaming/zero_copy_parser.rs:25:5
   |
19 | pub struct ZeroCopyParser {
   |            -------------- field in this struct
...
25 |     state: ParserState,
   |     ^^^^^

warning: variants `InMessageHeader`, `InRelease`, `InResource`, and `Done` are never constructed
  --> packages/ddex-parser/src/streaming/zero_copy_parser.rs:72:5
   |
70 | enum ParserState {
   |      ----------- variants in this enum
71 |     Initial,
72 |     InMessageHeader,
   |     ^^^^^^^^^^^^^^^
73 |     InRelease {
   |     ^^^^^^^^^
...
76 |     InResource {
   |     ^^^^^^^^^^
...
80 |     Done,
   |     ^^^^
   |
   = note: `ParserState` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis

warning: method `find_closing_tag_simple` is never used
   --> packages/ddex-parser/src/streaming/zero_copy_parser.rs:699:8
    |
137 | impl ZeroCopyParser {
    | ------------------- method in this implementation
...
699 |     fn find_closing_tag_simple(&self, data: &[u8], start: usize, tag_name: &str) -> Option<usize> {
    |        ^^^^^^^^^^^^^^^^^^^^^^^

warning: field `reader` is never read
   --> packages/ddex-parser/src/streaming/zero_copy_parser.rs:725:5
    |
724 | pub struct ZeroCopyStreamIterator<R: BufRead> {
    |            ---------------------- field in this struct
725 |     reader: R,
    |     ^^^^^^

warning: fields `position` and `chunk_size` are never read
   --> packages/ddex-parser/src/streaming/zero_copy_parser.rs:893:5
    |
890 | pub struct ZeroCopyIterator {
    |            ---------------- fields in this struct
...
893 |     position: usize,
    |     ^^^^^^^^
894 |     chunk_size: usize,
    |     ^^^^^^^^^^

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/aligned_comprehensive.rs:575:13
    |
575 |         let mut iterator = AlignedStreamIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/fast_zero_copy.rs:430:13
    |
430 |         let mut iterator = FastZeroCopyIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: stripping a prefix manually
   --> packages/ddex-parser/src/parser/xpath_selector.rs:313:37
    |
313 |                     let attr_expr = &filter[1..]; // Remove @
    |                                     ^^^^^^^^^^^^
    |
note: the prefix was tested here
   --> packages/ddex-parser/src/parser/xpath_selector.rs:311:17
    |
311 |                 if filter.starts_with('@') {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
    = note: `#[warn(clippy::manual_strip)]` on by default
help: try using the `strip_prefix` method
    |
311 ~                 if let Some(attr_expr) = filter.strip_prefix('@') {
312 |                     // Attribute filter [@attr] or [@attr="value"]
313 ~                     // Remove @
    |

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/parallel_parser.rs:504:13
    |
504 |         let mut iterator = ParallelStreamingIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/perf_analysis.rs:126:13
    |
126 |         let mut iterator = WorkingStreamIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: unused variable: `initial_stats`
   --> packages/ddex-parser/src/streaming/perf_analysis.rs:267:13
    |
267 |         let initial_stats = iterator.stats();
    |             ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_initial_stats`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `final_stats`
   --> packages/ddex-parser/src/streaming/perf_analysis.rs:286:13
    |
286 |         let final_stats = iterator.stats();
    |             ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_final_stats`

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/parallel_benchmark.rs:206:13
    |
206 |         let mut working_iterator = WorkingStreamIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/parallel_benchmark.rs:235:13
    |
235 |         let mut parallel_iterator = ParallelStreamingIterator::new(cursor, ERNVersion::V4_3);
    |             ----^^^^^^^^^^^^^^^^^
    |             |
    |             help: remove this `mut`

warning: you seem to use `.enumerate()` and immediately discard the index
   --> packages/ddex-parser/src/lib.rs:171:43
    |
171 |         for (_total_elements, element) in iterator.enumerate() {
    |                                           ^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
    = note: `#[warn(clippy::unused_enumerate_index)]` on by default
help: remove the `.enumerate()` call
    |
171 -         for (_total_elements, element) in iterator.enumerate() {
171 +         for element in iterator {
    |

warning: variable does not need to be mutable
   --> packages/ddex-parser/src/streaming/parallel_benchmark.rs:419:21
    |
419 |                 let mut iterator =
    |                     ----^^^^^^^^
    |                     |
    |                     help: remove this `mut`

warning: `ddex-parser` (lib) generated 16 warnings (run `cargo clippy --fix --lib -p ddex-parser` to apply 2 suggestions)
warning: used `assert_eq!` with a literal bool
   --> packages/ddex-parser/src/parser/attribute_extractor.rs:581:17
    |
581 |                 assert_eq!(*is_default, true);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
    = note: `#[warn(clippy::bool_assert_comparison)]` on by default
help: replace it with `assert!(..)`
    |
581 -                 assert_eq!(*is_default, true);
581 +                 assert!(*is_default);
    |

warning: used `assert_eq!` with a literal bool
   --> packages/ddex-parser/src/parser/attribute_extractor.rs:648:17
    |
648 |                 assert_eq!(*nil_value, true);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
    |
648 -                 assert_eq!(*nil_value, true);
648 +                 assert!(*nil_value);
    |

warning: length comparison to one
   --> packages/ddex-parser/src/parser/attribute_extractor.rs:681:17
    |
681 |         assert!(standard.len() >= 1); // Should contain LanguageAndScriptCode
    |                 ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!standard.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

warning: length comparison to one
   --> packages/ddex-parser/src/parser/attribute_extractor.rs:682:17
    |
682 |         assert!(extensions.len() >= 1); // Should contain custom:proprietary
    |                 ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extensions.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero

warning: module has the same name as its containing module
  --> packages/ddex-parser/src/parser/tests.rs:2:1
   |
2  | / mod tests {
3  | |     use crate::parser::detector::VersionDetector;
4  | |     use crate::parser::security::SecurityConfig;
5  | |     use ddex_core::models::versions::ERNVersion;
...  |
52 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
   = note: `#[warn(clippy::module_inception)]` on by default

warning: length comparison to one
   --> packages/ddex-parser/src/streaming/minimal.rs:234:17
    |
234 |         assert!(elements.len() >= 1);
    |                 ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!elements.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero

warning: using `clone` on type `Option<u32>` which implements the `Copy` trait
   --> packages/ddex-parser/src/streaming/comprehensive_tests.rs:382:47
    |
382 |                 } => Some((reference.clone(), width.clone(), height.clone())),
    |                                               ^^^^^^^^^^^^^ help: try dereferencing it: `*width`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[warn(clippy::clone_on_copy)]` on by default

warning: using `clone` on type `Option<u32>` which implements the `Copy` trait
   --> packages/ddex-parser/src/streaming/comprehensive_tests.rs:382:62
    |
382 |                 } => Some((reference.clone(), width.clone(), height.clone())),
    |                                                              ^^^^^^^^^^^^^^ help: try dereferencing it: `*height`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: this loop could be written as a `for` loop
   --> packages/ddex-parser/src/streaming/comprehensive_tests.rs:447:9
    |
447 |         while let Some(result) = iterator.next() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for result in iterator.by_ref()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
    = note: `#[warn(clippy::while_let_on_iterator)]` on by default

warning: this loop could be written as a `for` loop
   --> packages/ddex-parser/src/streaming/comprehensive_tests.rs:522:9
    |
522 |         while let Some(result) = iterator.next() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for result in iterator`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

warning: this loop could be written as a `for` loop
   --> packages/ddex-parser/src/streaming/perf_analysis.rs:155:5
    |
155 |     while let Some(result) = iterator.next() {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for result in iterator`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

warning: you should consider adding a `Default` implementation for `PerformanceAnalyzer`
   --> packages/ddex-parser/src/streaming/perf_analysis.rs:232:5
    |
232 | /     pub fn new() -> Self {
233 | |         Self {
234 | |             results: Vec::new(),
235 | |         }
236 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
    = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
    |
231 + impl Default for PerformanceAnalyzer {
232 +     fn default() -> Self {
233 +         Self::new()
234 +     }
235 + }
    |

warning: this loop could be written as a `for` loop
   --> packages/ddex-parser/src/streaming/zero_copy_benchmark.rs:111:5
    |
111 |     while let Some(result) = iterator.next() {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for result in iterator`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

warning: this loop could be written as a `for` loop
   --> packages/ddex-parser/src/streaming/zero_copy_benchmark.rs:131:5
    |
131 |     while let Some(result) = iterator.next() {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for result in iterator`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

warning: length comparison to one
   --> packages/ddex-parser/src/api_integration_test.rs:135:17
    |
135 |                 elements.len() >= 1,
    |                 ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!elements.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero

warning: `ddex-parser` (lib test) generated 43 warnings (14 duplicates) (run `cargo clippy --fix --lib -p ddex-parser --tests` to apply 26 suggestions)
warning: `crate` references the macro call's crate
  --> packages/ddex-parser/tests/test_categories.rs:54:17
   |
54 |             use crate::test_categories::TestCategory;
   |                 ^^^^^ help: to reference the macro definition's crate, use: `$crate`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
   = note: `#[warn(clippy::crate_in_macro_def)]` on by default

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
 --> packages/ddex-parser/tests/error_contract_test.rs:8:18
  |
8 |     let result = parser.parse(std::io::Cursor::new(invalid_xml.as_bytes()));
  |                  ^^^^^^ cannot borrow as mutable
  |
help: consider changing this to be mutable
  |
6 |     let mut parser = DDEXParser::new();
  |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/error_contract_test.rs:17:18
   |
17 |     let result = parser.parse(std::io::Cursor::new(empty.as_bytes()));
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
15 |     let mut parser = DDEXParser::new();
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/error_contract_test.rs:25:18
   |
25 |     let result = parser.parse(std::io::Cursor::new(malformed.as_bytes()));
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
23 |     let mut parser = DDEXParser::new();
   |         +++

For more information about this error, try `rustc --explain E0596`.
warning: this import is redundant
 --> packages/ddex-parser/tests/final_v0_4_0_validation.rs:6:1
  |
6 | use chrono;
  | ^^^^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
  = note: `#[warn(clippy::single_component_path_imports)]` on by default

warning: ddex-parser@0.4.0: Generating TypeScript definitions...
error: could not compile `ddex-parser` (test "error_contract_test") due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0308]: mismatched types
  --> packages/ddex-parser/examples/fast_streaming_usage.rs:41:43
   |
41 |     let iterator = parser.parse_streaming(reader, None)?;
   |                           --------------- ^^^^^^ expected `&mut _`, found `BufReader<Cursor<&[u8]>>`
   |                           |
   |                           arguments to this method are incorrect
   |
   = note: expected mutable reference `&mut _`
                         found struct `std::io::BufReader<std::io::Cursor<&[u8]>>`
note: method defined here
  --> /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-parser/src/streaming/fast_streaming_parser.rs:89:12
   |
89 |     pub fn parse_streaming<R: BufRead>(
   |            ^^^^^^^^^^^^^^^
help: consider mutably borrowing here
   |
41 |     let iterator = parser.parse_streaming(&mut reader, None)?;
   |                                           ++++

warning: function `summarize_test_results` is never used
   --> packages/ddex-parser/tests/test_categories.rs:159:8
    |
159 | pub fn summarize_test_results(
    |        ^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: trait `StringRepeat` is never used
   --> packages/ddex-parser/tests/test_categories.rs:206:7
    |
206 | trait StringRepeat {
    |       ^^^^^^^^^^^^

warning: `ddex-parser` (test "final_v0_4_0_validation") generated 1 warning (run `cargo clippy --fix --test "final_v0_4_0_validation"` to apply 1 suggestion)
error[E0308]: mismatched types
  --> packages/ddex-parser/examples/fast_streaming_usage.rs:94:43
   |
94 |     let iterator = parser.parse_streaming(reader, Some(progress_callback))?;
   |                           --------------- ^^^^^^ expected `&mut _`, found `BufReader<Cursor<&[u8]>>`
   |                           |
   |                           arguments to this method are incorrect
   |
   = note: expected mutable reference `&mut _`
                         found struct `std::io::BufReader<std::io::Cursor<&[u8]>>`
note: method defined here
  --> /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-parser/src/streaming/fast_streaming_parser.rs:89:12
   |
89 |     pub fn parse_streaming<R: BufRead>(
   |            ^^^^^^^^^^^^^^^
help: consider mutably borrowing here
   |
94 |     let iterator = parser.parse_streaming(&mut reader, Some(progress_callback))?;
   |                                           ++++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/v0_4_0_final_tests.rs:831:11
    |
831 |     match parser.parse(cursor) {
    |           ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
828 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/v0_4_0_final_tests.rs:925:15
    |
925 |         match parser.parse(cursor) {
    |               ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
922 |         let mut parser = DDEXParser::new();
    |             +++

warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used
   --> packages/ddex-parser/tests/improved_failing_tests.rs:245:25
    |
245 | /                         for attr in e.attributes() {
246 | |                             if let Ok(attr) = attr {
247 | |                                 let key = std::str::from_utf8(attr.key.as_ref()).unwrap_or("?");
248 | |                                 if key == "ReleaseReference" {
...   |
254 | |                         }
    | |_________________________^
    |
help: try `.flatten()` and remove the `if let` statement in the for loop
   --> packages/ddex-parser/tests/improved_failing_tests.rs:246:29
    |
246 | / ...                   if let Ok(attr) = attr {
247 | | ...                       let key = std::str::from_utf8(attr.key.as_ref()).unwrap_or("?");
248 | | ...                       if key == "ReleaseReference" {
249 | | ...                           current_release = Some(
...   |
253 | | ...                   }
    | |_______________________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
    = note: `#[warn(clippy::manual_flatten)]` on by default
help: try
    |
245 ~                         for attr in e.attributes().flatten() {
246 +                             let key = std::str::from_utf8(attr.key.as_ref()).unwrap_or("?");
247 +                             if key == "ReleaseReference" {
248 +                                 current_release = Some(
249 +                                     std::str::from_utf8(&attr.value).unwrap_or("?").to_string()
250 +                                 );
251 +                             }
252 +                         }
    |

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
    --> packages/ddex-parser/tests/v0_4_0_final_tests.rs:1177:11
     |
1177 |     match parser.parse(cursor) {
     |           ^^^^^^ cannot borrow as mutable
     |
help: consider changing this to be mutable
     |
1174 |     let mut parser = DDEXParser::new();
     |         +++

error[E0308]: mismatched types
   --> packages/ddex-parser/examples/fast_streaming_usage.rs:163:43
    |
163 |     let iterator = parser.parse_streaming(reader, Some(progress_callback))?;
    |                           --------------- ^^^^^^ expected `&mut _`, found `BufReader<Cursor<&[u8]>>`
    |                           |
    |                           arguments to this method are incorrect
    |
    = note: expected mutable reference `&mut _`
                          found struct `std::io::BufReader<std::io::Cursor<&[u8]>>`
note: method defined here
   --> /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-parser/src/streaming/fast_streaming_parser.rs:89:12
    |
89  |     pub fn parse_streaming<R: BufRead>(
    |            ^^^^^^^^^^^^^^^
help: consider mutably borrowing here
    |
163 |     let iterator = parser.parse_streaming(&mut reader, Some(progress_callback))?;
    |                                           ++++

error[E0308]: mismatched types
   --> packages/ddex-parser/examples/fast_streaming_usage.rs:239:47
    |
239 |         let iterator = parser.parse_streaming(reader, None)?;
    |                               --------------- ^^^^^^ expected `&mut _`, found `BufReader<Cursor<&[u8]>>`
    |                               |
    |                               arguments to this method are incorrect
    |
    = note: expected mutable reference `&mut _`
                          found struct `std::io::BufReader<std::io::Cursor<&[u8]>>`
note: method defined here
   --> /Users/kevinmoo/Desktop/localrepo/ddex-suite/packages/ddex-parser/src/streaming/fast_streaming_parser.rs:89:12
    |
89  |     pub fn parse_streaming<R: BufRead>(
    |            ^^^^^^^^^^^^^^^
help: consider mutably borrowing here
    |
239 |         let iterator = parser.parse_streaming(&mut reader, None)?;
    |                                               ++++

warning: ddex-parser@0.4.0: Generating TypeScript definitions...
error: could not compile `ddex-parser` (test "v0_4_0_final_tests") due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/depth_limit_test.rs:15:18
   |
15 |     let result = parser.parse(cursor);
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
12 |     let mut parser = DDEXParser::with_config(security_config);
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/depth_limit_test.rs:36:11
   |
36 |     match parser.parse(cursor) {
   |           ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
31 |     let mut parser = DDEXParser::new();
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/depth_limit_test.rs:55:18
   |
55 |     let result = parser.parse(cursor);
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
53 |     let mut parser = DDEXParser::with_config(security_config);
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/depth_limit_test.rs:76:11
   |
76 |     match parser.parse(cursor) {
   |           ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
71 |     let mut parser = DDEXParser::with_config(security_config);
   |         +++

warning: ddex-parser@0.4.0: Generating TypeScript definitions...
error: could not compile `ddex-parser` (example "fast_streaming_usage") due to 4 previous errors
warning: `ddex-parser` (test "improved_failing_tests") generated 4 warnings (run `cargo clippy --fix --test "improved_failing_tests"` to apply 2 suggestions)
warning: ddex-parser@0.4.0: Generating TypeScript definitions...
error: could not compile `ddex-parser` (test "depth_limit_test") due to 4 previous errors
warning: unused import: `ddex_parser::parser::security::SecurityConfig`
 --> packages/ddex-parser/tests/utf8_handling_test.rs:1:5
  |
1 | use ddex_parser::parser::security::SecurityConfig;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/utf8_handling_test.rs:34:18
   |
34 |     let result = parser.parse(cursor).unwrap();
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
32 |     let mut parser = DDEXParser::new();
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
  --> packages/ddex-parser/tests/utf8_handling_test.rs:72:18
   |
72 |     let result = parser.parse(cursor);
   |                  ^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
70 |     let mut parser = DDEXParser::new();
   |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:110:18
    |
110 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
108 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:145:18
    |
145 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
143 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:183:18
    |
183 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
181 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:229:18
    |
229 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
227 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:281:18
    |
281 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
279 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:317:18
    |
317 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
315 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:351:18
    |
351 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
349 |     let mut parser = DDEXParser::new();
    |         +++

error[E0596]: cannot borrow `parser` as mutable, as it is not declared as mutable
   --> packages/ddex-parser/tests/utf8_handling_test.rs:391:18
    |
391 |     let result = parser.parse(cursor);
    |                  ^^^^^^ cannot borrow as mutable
    |
help: consider changing this to be mutable
    |
389 |     let mut parser = DDEXParser::new();
    |         +++

warning: `ddex-parser` (test "utf8_handling_test") generated 1 warning
warning: ddex-parser@0.4.0: Generating TypeScript definitions...
error: could not compile `ddex-parser` (test "utf8_handling_test") due to 10 previous errors; 1 warning emitted