Skip to content

Commit 731e203

Browse files
committed
zephyr-build: Remove 'static from const strings
Remove the `'static` from const strings, as this causes the clippy warning "redundant_static_lifetimes". Signed-off-by: David Brown <[email protected]>
1 parent 8d78168 commit 731e203

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

zephyr-build/src/devicetree/output.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ fn general_property(prop: &Property) -> TokenStream {
192192
let tag = format!("{}_DEBUG", prop.name);
193193
let tag = dt_to_upper_id(&tag);
194194
quote! {
195-
pub const #tag: &'static str = #text;
195+
pub const #tag: &str = #text;
196196
}
197197
}
198198

199199
/// Given a DT name, return an identifier for a lower-case version.
200200
pub fn dt_to_lower_id(text: &str) -> Ident {
201-
format_ident!("{}", fix_id(&text))
201+
format_ident!("{}", fix_id(text))
202202
}
203203

204204
pub fn dt_to_upper_id(text: &str) -> Ident {

zephyr-build/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ pub fn build_kconfig_mod() {
7272
writeln!(&mut f, "pub const {}: isize = {};", &caps[1], &caps[2]).unwrap();
7373
} else if let Some(caps) = config_str.captures(&line) {
7474
writeln!(&mut f, "#[allow(dead_code)]").unwrap();
75-
writeln!(
76-
&mut f,
77-
"pub const {}: &'static str = {};",
78-
&caps[1], &caps[2]
79-
)
80-
.unwrap();
75+
writeln!(&mut f, "pub const {}: &str = {};", &caps[1], &caps[2]).unwrap();
8176
}
8277
}
8378
}

0 commit comments

Comments
 (0)