mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 06:49:19 +00:00
Clippy suggestions implemented
This commit is contained in:
parent
4d461e0381
commit
2b79927300
@ -1,4 +1,5 @@
|
||||
use std::fs;
|
||||
use std::io::Error;
|
||||
use std::path::PathBuf;
|
||||
|
||||
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(){
|
||||
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() {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use std::fs;
|
||||
use std::io::Error;
|
||||
use std::path::PathBuf;
|
||||
|
||||
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() {
|
||||
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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user