Skip to content

Commit

Permalink
strings
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Oct 19, 2024
1 parent dbd8734 commit c13b87d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/generate/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ pub fn render(
interrupt
.0
.description
.as_ref()
.map(|s| util::respace(s))
.as_ref()
.map(|s| util::escape_special_chars(s))
.as_deref()
.map(util::respace)
.as_deref()
.map(util::escape_special_chars)
.unwrap_or_else(|| interrupt.0.name.clone())
);

Expand Down
10 changes: 5 additions & 5 deletions src/generate/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl Region {
let mut idents: Vec<_> = self
.rbfs
.iter()
.filter_map(|f| f.syn_field.ident.as_ref().map(|ident| ident.to_string()))
.filter_map(|f| f.syn_field.ident.as_ref().map(ToString::to_string))
.collect();
if idents.is_empty() {
return None;
Expand Down Expand Up @@ -343,7 +343,7 @@ impl Region {
let idents: Vec<_> = self
.rbfs
.iter()
.filter_map(|f| f.syn_field.ident.as_ref().map(|ident| ident.to_string()))
.filter_map(|f| f.syn_field.ident.as_ref().map(ToString::to_string))
.collect();

if idents.is_empty() {
Expand Down Expand Up @@ -726,7 +726,7 @@ fn check_erc_derive_infos(
};
match register {
Register::Single(_) => {
let ty_name = info_name.to_string();
let ty_name = info_name.clone();
*derive_info = match explicit_rpath {
None => {
match compare_this_against_prev(
Expand Down Expand Up @@ -758,7 +758,7 @@ fn check_erc_derive_infos(
let re = Regex::new(format!("^{re_string}$").as_str()).map_err(|_| {
anyhow!("Error creating regex for register {}", register.name)
})?;
let ty_name = info_name.to_string(); // keep suffix for regex matching
let ty_name = info_name.clone(); // keep suffix for regex matching
*derive_info = match explicit_rpath {
None => {
match compare_this_against_prev(
Expand Down Expand Up @@ -787,7 +787,7 @@ fn check_erc_derive_infos(
}
RegisterCluster::Cluster(cluster) => {
*derive_info = DeriveInfo::Cluster;
ercs_type_info.push((cluster.name.to_string(), None, erc, derive_info));
ercs_type_info.push((cluster.name.clone(), None, erc, derive_info));
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ fn api_docs(
let idx = format!("[{idx}]");
rpath.name.replace("[%s]", &idx).replace("%s", &idx)
} else {
rpath.name.to_string()
rpath.name.clone()
};
// TODO: support html_urls for registers in cluster
if rpath.block.path.is_empty() {
Expand Down

0 comments on commit c13b87d

Please sign in to comment.