Clippy suggestions implemented

This commit is contained in:
Kivanc 2025-12-12 15:41:31 +03:00
parent 4d461e0381
commit 2b79927300
2 changed files with 4 additions and 7 deletions

View File

@ -1,4 +1,5 @@
use std::fs; use std::fs;
use std::io::Error;
use std::path::PathBuf; use std::path::PathBuf;
fn main() -> Result<(), std::io::Error> { fn main() -> Result<(), std::io::Error> {
@ -33,7 +34,7 @@ fn create_required_files() -> Result<(), std::io::Error> {
let dir_path = match file_path.parent(){ let dir_path = match file_path.parent(){
Some(parent) => parent, Some(parent) => parent,
None => return Err(std::io::Error::new(std::io::ErrorKind::Other, "Could not get parent path")), None => return Err(Error::other("Could not get parent path")),
}; };
if !dir_path.exists() { if !dir_path.exists() {

View File

@ -1,4 +1,5 @@
use std::fs; use std::fs;
use std::io::Error;
use std::path::PathBuf; use std::path::PathBuf;
fn main() -> Result<(), std::io::Error> { fn main() -> Result<(), std::io::Error> {
@ -32,12 +33,7 @@ fn create_required_files() -> Result<(), std::io::Error> {
let dir_path = match file_path.parent() { let dir_path = match file_path.parent() {
Some(parent) => parent, Some(parent) => parent,
None => { None => return Err(Error::other("Could not get parent path"))
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Could not get parent path",
));
}
}; };
if !dir_path.exists() { if !dir_path.exists() {