|
|
@@ -20,13 +20,12 @@ impl FileType {
|
|
|
if path.is_dir() {
|
|
|
files.append(&mut FileType::get_all(path));
|
|
|
} else if path.is_file() {
|
|
|
- if let Some(filename) = path.file_name() {
|
|
|
- let name = filename.to_string_lossy();
|
|
|
- if name == "index.html" {
|
|
|
- files.push(FileType::HtmlIndex(path))
|
|
|
- } else if name == "neovan.html" {
|
|
|
- files.push(FileType::NeovanIndex(path))
|
|
|
- }
|
|
|
+ let filename = path.file_name().expect("Error reading file").to_string_lossy();
|
|
|
+
|
|
|
+ if filename == "index.html" {
|
|
|
+ files.push(FileType::HtmlIndex(path))
|
|
|
+ } else if filename == "index.neovan" {
|
|
|
+ files.push(FileType::NeovanIndex(path))
|
|
|
} else if let Some(ext) = path.extension() {
|
|
|
if ext == "html" {
|
|
|
files.push(FileType::HtmlComponent(path))
|