Skip to content

Commit ba8c8a3

Browse files
committed
Get rid of unproven flag since it has proven itself by now? Bump up rayon and once_cell while we are at it. Bumping xmltree would require another PR since 0.9.x and above require more thorough changes
1 parent c1dad9e commit ba8c8a3

25 files changed

+102
-103
lines changed

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ readme = "README.md"
1515

1616
[features]
1717
derive-from = []
18-
unproven = []
1918

2019
[dependencies]
2120
xmltree = "0.8"
2221
anyhow = "1.0.19"
2322
thiserror = "1.0.5"
24-
rayon = "1.3.0"
25-
once_cell = "1.3.1"
23+
rayon = "1.5.0"
24+
once_cell = "1.5.2"
2625
regex = "1"
2726

2827
[dependencies.serde]

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
#![deny(warnings)]
2626

27-
#[cfg(feature = "unproven")]
27+
2828
use std::collections::HashMap;
2929

3030
use xmltree::Element;
@@ -41,9 +41,9 @@ use anyhow::Result;
4141
pub mod parse;
4242
use parse::Parse;
4343
// Encode defines encoding interfaces
44-
#[cfg(feature = "unproven")]
44+
4545
pub mod encode;
46-
#[cfg(feature = "unproven")]
46+
4747
use encode::Encode;
4848
// Types defines simple types and parse/encode implementations
4949
pub mod types;
@@ -61,7 +61,7 @@ pub fn parse(xml: &str) -> Result<Device> {
6161
}
6262

6363
/// Encodes a device object to an SVD (XML) string
64-
#[cfg(feature = "unproven")]
64+
6565
pub fn encode(d: &Device) -> Result<String> {
6666
let root = d.encode()?;
6767
let mut wr = Vec::new();
@@ -79,7 +79,7 @@ fn trim_utf8_bom(s: &str) -> &str {
7979
}
8080

8181
/// Helper to create new base xml elements
82-
#[cfg(feature = "unproven")]
82+
8383
pub(crate) fn new_element(name: &str, text: Option<String>) -> Element {
8484
Element {
8585
prefix: None,
@@ -96,7 +96,7 @@ pub(crate) fn new_element(name: &str, text: Option<String>) -> Element {
9696
/// Takes an array of (item, xml) pairs where the item implements
9797
/// Parse and Encode and tests object encoding and decoding
9898
#[cfg(test)]
99-
#[cfg(feature = "unproven")]
99+
100100
pub fn run_test<
101101
T: Parse<Error = anyhow::Error, Object = T>
102102
+ Encode<Error = anyhow::Error>

src/svd/access.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use xmltree::Element;
22

33
use crate::elementext::ElementExt;
4-
#[cfg(feature = "unproven")]
4+
55
use crate::encode::Encode;
66
use crate::error::*;
7-
#[cfg(feature = "unproven")]
7+
88
use crate::new_element;
99
use crate::types::Parse;
1010

@@ -36,7 +36,7 @@ impl Parse for Access {
3636
}
3737
}
3838

39-
#[cfg(feature = "unproven")]
39+
4040
impl Encode for Access {
4141
type Error = anyhow::Error;
4242

@@ -54,7 +54,7 @@ impl Encode for Access {
5454
}
5555

5656
#[cfg(test)]
57-
#[cfg(feature = "unproven")]
57+
5858
mod tests {
5959
use super::*;
6060
use crate::run_test;

src/svd/addressblock.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#[cfg(feature = "unproven")]
1+
22
use std::collections::HashMap;
33

44
use crate::elementext::ElementExt;
55
use xmltree::Element;
66

77
use crate::types::Parse;
88

9-
#[cfg(feature = "unproven")]
9+
1010
use crate::encode::Encode;
1111
use crate::error::*;
12-
#[cfg(feature = "unproven")]
12+
1313
use crate::new_element;
1414

1515
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
@@ -33,7 +33,7 @@ impl Parse for AddressBlock {
3333
}
3434
}
3535

36-
#[cfg(feature = "unproven")]
36+
3737
impl Encode for AddressBlock {
3838
type Error = anyhow::Error;
3939

@@ -55,7 +55,7 @@ impl Encode for AddressBlock {
5555
}
5656

5757
#[cfg(test)]
58-
#[cfg(feature = "unproven")]
58+
5959
mod tests {
6060
use super::*;
6161
use crate::run_test;

src/svd/bitrange.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use xmltree::Element;
22

33
use crate::error::*;
4-
#[cfg(feature = "unproven")]
4+
55
use crate::new_element;
66
use crate::types::Parse;
77

@@ -120,7 +120,7 @@ impl Parse for BitRange {
120120
})
121121
}
122122
}
123-
#[cfg(feature = "unproven")]
123+
124124
impl BitRange {
125125
// TODO: Encode method differs from Encode trait as it acts on a set of possible children, create an interface or decide how to better do this
126126
pub fn encode(&self) -> Result<Vec<Element>> {
@@ -142,7 +142,7 @@ impl BitRange {
142142
}
143143

144144
#[cfg(test)]
145-
#[cfg(feature = "unproven")]
145+
146146
mod tests {
147147
use super::*;
148148

src/svd/cluster.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use xmltree::Element;
33

44
use crate::types::Parse;
55

6-
#[cfg(feature = "unproven")]
6+
77
use crate::elementext::ElementExt;
8-
#[cfg(feature = "unproven")]
8+
99
use crate::encode::Encode;
1010
use crate::error::*;
1111
use crate::svd::{clusterinfo::ClusterInfo, dimelement::DimElement};
@@ -55,7 +55,7 @@ impl Parse for Cluster {
5555
}
5656
}
5757

58-
#[cfg(feature = "unproven")]
58+
5959
impl Encode for Cluster {
6060
type Error = anyhow::Error;
6161

src/svd/clusterinfo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use xmltree::Element;
33

44
use crate::types::Parse;
55

6-
#[cfg(feature = "unproven")]
6+
77
use crate::encode::{Encode, EncodeChildren};
8-
#[cfg(feature = "unproven")]
8+
99
use crate::new_element;
1010

1111
use crate::error::*;
@@ -153,7 +153,7 @@ impl ClusterInfo {
153153
}
154154
}
155155

156-
#[cfg(feature = "unproven")]
156+
157157
impl Encode for ClusterInfo {
158158
type Error = anyhow::Error;
159159

src/svd/cpu.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#[cfg(feature = "unproven")]
1+
22
use std::collections::HashMap;
33

44
use xmltree::Element;
55

66
use crate::elementext::ElementExt;
7-
#[cfg(feature = "unproven")]
7+
88
use crate::encode::Encode;
99
use crate::error::*;
10-
#[cfg(feature = "unproven")]
10+
1111
use crate::new_element;
1212
use crate::svd::endian::Endian;
1313
use crate::types::Parse;
@@ -137,7 +137,7 @@ impl Parse for Cpu {
137137
}
138138
}
139139

140-
#[cfg(feature = "unproven")]
140+
141141
impl Encode for Cpu {
142142
type Error = anyhow::Error;
143143

@@ -172,7 +172,7 @@ impl Cpu {
172172
}
173173

174174
#[cfg(test)]
175-
#[cfg(feature = "unproven")]
175+
176176
mod tests {
177177
use super::*;
178178
use crate::run_test;

src/svd/device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::elementext::ElementExt;
2-
#[cfg(feature = "unproven")]
2+
33
use std::collections::HashMap;
44
use xmltree::Element;
55

@@ -8,10 +8,10 @@ use rayon::prelude::*;
88
use crate::parse;
99
use crate::types::Parse;
1010

11-
#[cfg(feature = "unproven")]
11+
1212
use crate::encode::{Encode, EncodeChildren};
1313
use crate::error::*;
14-
#[cfg(feature = "unproven")]
14+
1515
use crate::new_element;
1616
use crate::svd::{cpu::Cpu, peripheral::Peripheral, registerproperties::RegisterProperties};
1717

@@ -180,7 +180,7 @@ impl Device {
180180
}
181181
}
182182

183-
#[cfg(feature = "unproven")]
183+
184184
impl Encode for Device {
185185
type Error = anyhow::Error;
186186

src/svd/dimelement.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use xmltree::Element;
33
use crate::types::{parse_optional, DimIndex, Parse};
44

55
use crate::elementext::ElementExt;
6-
#[cfg(feature = "unproven")]
6+
77
use crate::encode::Encode;
8-
#[cfg(feature = "unproven")]
8+
99
use crate::new_element;
1010

1111
use crate::error::*;
@@ -77,7 +77,7 @@ impl Parse for DimElement {
7777
}
7878
}
7979

80-
#[cfg(feature = "unproven")]
80+
8181
impl Encode for DimElement {
8282
type Error = anyhow::Error;
8383

@@ -100,7 +100,7 @@ impl Encode for DimElement {
100100
}
101101

102102
#[cfg(test)]
103-
#[cfg(feature = "unproven")]
103+
104104
mod tests {
105105
use super::*;
106106
use crate::run_test;

0 commit comments

Comments
 (0)