Skip to content

Commit 35adf3a

Browse files
committed
fix
1 parent 5595df5 commit 35adf3a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

svd-parser/src/expand.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Provides [expand] method to convert arrays, clusters and derived items in regular instances
22
33
use anyhow::{anyhow, Result};
4-
use std::{collections::HashMap, fmt, mem::take, sync::Arc};
4+
use std::{collections::HashMap, fmt, mem::take, rc::Rc};
55
use svd_rs::{
66
array::names, cluster, field, peripheral, register, Cluster, ClusterInfo, DeriveFrom, Device,
77
EnumeratedValues, Field, Peripheral, Register, RegisterCluster, RegisterProperties,
@@ -10,23 +10,23 @@ use svd_rs::{
1010
/// Path to `peripheral` or `cluster` element
1111
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
1212
pub struct BlockPath {
13-
pub peripheral: Arc<str>,
14-
pub path: Vec<Arc<str>>,
13+
pub peripheral: Rc<str>,
14+
pub path: Vec<Rc<str>>,
1515
}
1616

1717
impl BlockPath {
18-
pub fn new(p: impl Into<Arc<str>>) -> Self {
18+
pub fn new(p: impl Into<Rc<str>>) -> Self {
1919
Self {
2020
peripheral: p.into(),
2121
path: Vec::new(),
2222
}
2323
}
24-
pub fn new_cluster(&self, name: impl Into<Arc<str>>) -> Self {
24+
pub fn new_cluster(&self, name: impl Into<Rc<str>>) -> Self {
2525
let mut child = self.clone();
2626
child.path.push(name.into());
2727
child
2828
}
29-
pub fn new_register(&self, name: impl Into<Arc<str>>) -> RegisterPath {
29+
pub fn new_register(&self, name: impl Into<Rc<str>>) -> RegisterPath {
3030
RegisterPath::new(self.clone(), name)
3131
}
3232
pub fn parse_str(s: &str) -> (Option<Self>, &str) {
@@ -91,17 +91,17 @@ impl fmt::Display for BlockPath {
9191
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
9292
pub struct RegisterPath {
9393
pub block: BlockPath,
94-
pub name: Arc<str>,
94+
pub name: Rc<str>,
9595
}
9696

9797
impl RegisterPath {
98-
pub fn new(block: BlockPath, name: impl Into<Arc<str>>) -> Self {
98+
pub fn new(block: BlockPath, name: impl Into<Rc<str>>) -> Self {
9999
Self {
100100
block,
101101
name: name.into(),
102102
}
103103
}
104-
pub fn new_field(&self, name: impl Into<Arc<str>>) -> FieldPath {
104+
pub fn new_field(&self, name: impl Into<Rc<str>>) -> FieldPath {
105105
FieldPath::new(self.clone(), name)
106106
}
107107
pub fn parse_str(s: &str) -> (Option<BlockPath>, &str) {
@@ -138,17 +138,17 @@ impl fmt::Display for RegisterPath {
138138
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
139139
pub struct FieldPath {
140140
pub register: RegisterPath,
141-
pub name: Arc<str>,
141+
pub name: Rc<str>,
142142
}
143143

144144
impl FieldPath {
145-
pub fn new(register: RegisterPath, name: impl Into<Arc<str>>) -> Self {
145+
pub fn new(register: RegisterPath, name: impl Into<Rc<str>>) -> Self {
146146
Self {
147147
register,
148148
name: name.into(),
149149
}
150150
}
151-
pub fn new_enum(&self, name: impl Into<Arc<str>>) -> EnumPath {
151+
pub fn new_enum(&self, name: impl Into<Rc<str>>) -> EnumPath {
152152
EnumPath::new(self.clone(), name)
153153
}
154154
pub fn parse_str(s: &str) -> (Option<RegisterPath>, &str) {
@@ -198,11 +198,11 @@ impl fmt::Display for FieldPath {
198198
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
199199
pub struct EnumPath {
200200
pub field: FieldPath,
201-
pub name: Arc<str>,
201+
pub name: Rc<str>,
202202
}
203203

204204
impl EnumPath {
205-
pub fn new(field: FieldPath, name: impl Into<Arc<str>>) -> Self {
205+
pub fn new(field: FieldPath, name: impl Into<Rc<str>>) -> Self {
206206
Self {
207207
field,
208208
name: name.into(),

0 commit comments

Comments
 (0)