add error handling for default case

This commit is contained in:
Wei 2022-09-19 18:13:42 +08:00
parent b127e0ea5b
commit 72c1c1564a
No known key found for this signature in database
GPG Key ID: 81FCFFF0A3750E5E

View File

@ -59,10 +59,9 @@ fn main() {
let mut name: Vec<&str> = text.split(".").collect();
let name = name[0];
let mut output = String::from("");
match category.0.as_str() {
let output = match category.0.as_str() {
"hosts" => {
output = format!(
format!(
"! FutaHosts\n\
! LowTechFilter {name}\n\
! URL: <https://github.com/FutaGuard/LowTechFilter>\n\
@ -73,7 +72,7 @@ fn main() {
)
}
"abp" => {
output = format!(
format!(
"[Adblock Plus]\n\
! Title: LowTechFilter {name}\n\
! Version: {version}\n\
@ -84,7 +83,9 @@ fn main() {
version = newversion
)
}
_ => {}
_ => {
continue;
}
};
// open and ready to write