fix: use clippy fix

This commit is contained in:
mrxiaozhuox committed 2022-01-25 12:42:27 +08:00
1 parent 66b832045a
commit 84d1867654
9 files changed
+36 -44

No files matched your search

+12 -17
View File
@@ -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");