Skip to content

Commit

Permalink
Merge pull request #24 from r0t3n/is_rust_file
Browse files Browse the repository at this point in the history
fix is_rust_rile
  • Loading branch information
ProbablyClem authored May 17, 2024
2 parents b4d06a6 + ffbb70d commit caf9c47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utoipauto-core/src/file_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ pub fn parse_files<T: Into<PathBuf>>(path: T) -> Result<Vec<(String, syn::File)>
}

fn is_rust_file(path: &Path) -> bool {
path.is_file() && path.extension().unwrap().to_str().unwrap().eq("rs")
path.is_file() && match path.extension() {
Some(ext) => match ext.to_str() {
Some(ext) => ext.eq("rs"),
None => false,
},
None => false,
}
}

/// Extract the module name from the file path
Expand Down

0 comments on commit caf9c47

Please sign in to comment.