🚨 Fix clippy warnings
This commit is contained in:
6
build.rs
6
build.rs
@@ -41,14 +41,14 @@ impl<'a> CssColorVariable<'a> {
|
||||
pub fn to_rust(&self) -> String {
|
||||
format!(
|
||||
"const {name}: &str = \"{value}\";",
|
||||
name = self.name.replace("-", "_").to_uppercase(),
|
||||
name = self.name.replace('-', "_").to_uppercase(),
|
||||
value = self.value
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn export_color_variables(src_path: &PathBuf, dst_path: &PathBuf) {
|
||||
let mut dst_file = File::create(&dst_path).unwrap();
|
||||
let mut dst_file = File::create(dst_path).unwrap();
|
||||
if let Err(err) = dst_file.write(b"#[allow(dead_code)]\nmod style {") {
|
||||
println!("{}", err);
|
||||
return;
|
||||
@@ -57,7 +57,7 @@ fn export_color_variables(src_path: &PathBuf, dst_path: &PathBuf) {
|
||||
let re = Regex::new(r"^\$([^:]+):[[:space:]]*#([^$]+);[[:space:]]*$").unwrap();
|
||||
|
||||
if let Ok(lines) = read_lines(src_path) {
|
||||
for line in lines.flatten() {
|
||||
for line in lines.map_while(Result::ok) {
|
||||
let Some(groups) = re.captures(&line) else {
|
||||
continue;
|
||||
};
|
||||
|
Reference in New Issue
Block a user