Merge pull request #84 from wei1769/error-handling

Error handling
This commit is contained in:
踢低吸 2022-09-19 21:30:49 +08:00 committed by GitHub
commit c9945b8a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.venv/
.idea/
**/target/

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