We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b4c783 commit f41b4d7Copy full SHA for f41b4d7
svd-parser/src/elementext.rs
@@ -34,12 +34,7 @@ impl<'a, 'input> ElementExt for Node<'a, 'input> {
34
where
35
K: AsRef<str>,
36
{
37
- for c in self.children() {
38
- if c.has_tag_name(k.as_ref()) {
39
- return Some(c);
40
- }
41
42
- None
+ self.children().find(|&c| c.has_tag_name(k.as_ref()))
43
}
44
fn get_child_text_opt<K>(&self, k: K) -> Result<Option<String>, SVDErrorAt>
45
svd-parser/src/expand.rs
@@ -571,11 +571,11 @@ pub fn derive_enumerated_values(
571
Ok(epath)
572
573
} else {
574
- return Err(anyhow!(
+ Err(anyhow!(
575
"enumeratedValues {} not found, parent field: {:?}",
576
dpath,
577
fpath,
578
- ));
+ ))
579
580
581
svd-parser/src/lib.rs
@@ -220,7 +220,7 @@ pub mod expand;
220
#[cfg(feature = "expand")]
221
pub use expand::{expand, expand_properties};
222
/// SVD parse Errors.
223
-#[derive(Clone, Debug, PartialEq, thiserror::Error)]
+#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]
224
pub enum SVDError {
225
#[error("{0}")]
226
Svd(#[from] svd::SvdError),
svd-rs/src/access.rs
@@ -1,7 +1,7 @@
1
/// Defines access rights for fields on the device, though it may be specified at a
2
/// higher level than individual fields.
3
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
4
-#[derive(Clone, Copy, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5
pub enum Access {
6
/// Read access is permitted. Write operations have an undefined effect.
7
#[cfg_attr(feature = "serde", serde(rename = "read-only"))]
svd-rs/src/addressblock.rs
@@ -2,7 +2,7 @@ use super::{BuildError, Protection, SvdError, ValidateLevel};
/// An uniquely mapped address block to a peripheral
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct AddressBlock {
8
/// Specifies the start address of an address block relative to the peripheral [`baseAddress`](crate::Peripheral::base_address).
@@ -63,7 +63,7 @@ impl AddressBlockUsage {
63
64
65
/// Builder for [`AddressBlock`]
66
-#[derive(Clone, Debug, Default, PartialEq)]
+#[derive(Clone, Debug, Default, PartialEq, Eq)]
67
pub struct AddressBlockBuilder {
68
offset: Option<u32>,
69
size: Option<u32>,
svd-rs/src/array.rs
@@ -2,7 +2,7 @@ use super::{DimElement, Name};
use core::ops::{Deref, DerefMut};
/// A single SVD instance or array of instances
pub enum MaybeArray<T> {
/// A single instance
Single(T),
svd-rs/src/bitrange.rs
@@ -7,7 +7,7 @@ pub enum Error {
9
/// A bit range, describing the [least significant bit](Self::lsb) and [most significant bit](Self::msb)
10
11
pub struct BitRange {
12
/// Value defining the position of the least significant bit of the field within the register
13
pub offset: u32,
@@ -20,7 +20,7 @@ pub struct BitRange {
20
21
22
/// The style of bit range that describes a [BitRange]
23
24
pub enum BitRangeType {
25
/// A bit range in the format: `[<msb>:<lsb>]`
26
BitRange,
svd-rs/src/cpu.rs
@@ -5,7 +5,7 @@ use super::{BuildError, Endian, SvdError, ValidateLevel};
derive(serde::Deserialize, serde::Serialize),
serde(rename_all = "camelCase")
)]
pub struct Cpu {
/// Processor architecture
@@ -99,7 +99,7 @@ pub struct Cpu {
99
100
101
/// Builder for [`Cpu`]
102
103
pub struct CpuBuilder {
104
name: Option<String>,
105
revision: Option<String>,
svd-rs/src/dimelement.rs
@@ -8,7 +8,7 @@ use std::ops::RangeInclusive;
pub struct DimElement {
14
/// Defines the number of elements in an array or list
@@ -55,7 +55,7 @@ pub struct DimElement {
55
56
57
58
59
pub struct DimArrayIndex {
60
/// Specify the base name of enumerations
61
#[cfg_attr(
@@ -69,7 +69,7 @@ pub struct DimArrayIndex {
70
71
/// Builder for [`DimElement`]
72
73
pub struct DimElementBuilder {
74
dim: Option<u32>,
75
dim_increment: Option<u32>,
svd-rs/src/endian.rs
@@ -4,7 +4,7 @@
serde(rename_all = "kebab-case")
pub enum Endian {
/// Little endian.
Little,
0 commit comments