mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
Fix errors on non-windows
This commit is contained in:
parent
e37e425a58
commit
877fd701c6
1 changed files with 1 additions and 9 deletions
|
@ -1,4 +1,3 @@
|
||||||
use std::io::ErrorKind;
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use mlua::prelude::*;
|
use mlua::prelude::*;
|
||||||
|
@ -123,14 +122,7 @@ fn append_extension(path: impl Into<PathBuf>, ext: &'static str) -> PathBuf {
|
||||||
|
|
||||||
fn is_file_not_found_error(err: &LuaError) -> bool {
|
fn is_file_not_found_error(err: &LuaError) -> bool {
|
||||||
if let ExternalError(err) = err {
|
if let ExternalError(err) = err {
|
||||||
if let Some(err) = err.as_ref().downcast_ref::<std::io::Error>() {
|
err.as_ref().downcast_ref::<std::io::Error>().is_some()
|
||||||
matches!(
|
|
||||||
err.kind(),
|
|
||||||
ErrorKind::NotFound | ErrorKind::PermissionDenied
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue