fix: use clippy fix
This commit is contained in:
1 parent
66b832045a
commit
84d1867654
9 files changed
+36
-44
No files matched your search
@@ -22,10 +22,8 @@ impl Build {
|
||||
crate_config.as_example(self.build.example.unwrap());
|
||||
}
|
||||
|
||||
if self.build.platform.is_some() {
|
||||
if self.build.platform.unwrap().to_uppercase() == "DESKTOP" {
|
||||
crate::builder::build_desktop(&crate_config)?;
|
||||
}
|
||||
if self.build.platform.is_some() && self.build.platform.unwrap().to_uppercase() == "DESKTOP" {
|
||||
crate::builder::build_desktop(&crate_config)?;
|
||||
}
|
||||
|
||||
crate::builder::build(&crate_config)?;
|
||||
|
||||
@@ -25,7 +25,7 @@ impl Config {
|
||||
match self {
|
||||
Config::Init { name, force } => {
|
||||
let conf_path = crate_root.join("Dioxus.toml");
|
||||
if conf_path.is_file() && force == false {
|
||||
if conf_path.is_file() && !force {
|
||||
log::warn!(
|
||||
"config file `Dioxus.toml` already exist, use `--force` to overwrite it."
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ impl Create {
|
||||
meta_file = meta_file.replace("{{project-name}}", &self.name);
|
||||
File::create(project_path.join("Dioxus.toml"))?.write_all(meta_file.as_bytes())?;
|
||||
|
||||
println!("");
|
||||
println!();
|
||||
log::info!("💡 Project initialized:");
|
||||
log::info!("🎯> cd ./{}", self.name);
|
||||
log::info!("🎯> dioxus serve");
|
||||
|
||||
+12
-17
@@ -21,27 +21,22 @@ impl Serve {
|
||||
crate_config.as_example(self.serve.example.unwrap());
|
||||
}
|
||||
|
||||
if self.serve.platform.is_some() {
|
||||
if self.serve.platform.unwrap().to_uppercase() == "DESKTOP" {
|
||||
crate::builder::build_desktop(&crate_config)?;
|
||||
if self.serve.platform.is_some() && self.serve.platform.unwrap().to_uppercase() == "DESKTOP" {
|
||||
crate::builder::build_desktop(&crate_config)?;
|
||||
|
||||
match &crate_config.executable {
|
||||
crate::ExecutableType::Binary(name)
|
||||
| crate::ExecutableType::Lib(name)
|
||||
| crate::ExecutableType::Example(name) => {
|
||||
let mut file = crate_config.out_dir.join(name);
|
||||
if cfg!(windows) {
|
||||
file.set_extension("exe");
|
||||
}
|
||||
Command::new(format!(
|
||||
"{}",
|
||||
crate_config.out_dir.join(file).to_str().unwrap()
|
||||
))
|
||||
.output()?;
|
||||
match &crate_config.executable {
|
||||
crate::ExecutableType::Binary(name)
|
||||
| crate::ExecutableType::Lib(name)
|
||||
| crate::ExecutableType::Example(name) => {
|
||||
let mut file = crate_config.out_dir.join(name);
|
||||
if cfg!(windows) {
|
||||
file.set_extension("exe");
|
||||
}
|
||||
Command::new(crate_config.out_dir.join(file).to_str().unwrap().to_string())
|
||||
.output()?;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
crate::builder::build(&crate_config).expect("build failed");
|
||||
|
||||
@@ -48,7 +48,7 @@ impl Translate {
|
||||
exit(0);
|
||||
})
|
||||
});
|
||||
if let None = temp {
|
||||
if temp.is_none() {
|
||||
if let Some(s) = source {
|
||||
contents = s;
|
||||
} else {
|
||||
@@ -112,7 +112,7 @@ fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result {
|
||||
}
|
||||
write!(f, "\",")?;
|
||||
}
|
||||
write!(f, "\n")?;
|
||||
writeln!(f)?;
|
||||
|
||||
// write the attributes
|
||||
if let Some(id) = &el.id {
|
||||
|
||||
@@ -120,7 +120,7 @@ fn render_element<'a>(
|
||||
}
|
||||
write!(f, "\",")?;
|
||||
}
|
||||
write!(f, "\n")?;
|
||||
writeln!(f)?;
|
||||
|
||||
// write the attributes
|
||||
if let Some(id) = &el.id {
|
||||
|
||||
Reference in new issue
Block a user