Skip to content

Commit

Permalink
Variable renaming to match other functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kongsgaard authored and Daniel Kongsgaard committed Sep 24, 2023
1 parent bca589c commit 8bde97d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua-api-crates/filesystem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ async fn read_dir<'lua>(_: &'lua Lua, path: String) -> mlua::Result<Vec<String>>

// similar (but not equal) to the shell command basename
async fn basename<'lua>(_: &'lua Lua, path: String) -> mlua::Result<String> {
let path = Path::new(&path);
if let Some(basename) = path.file_name() {
let path_rs = Path::new(&path);
if let Some(basename) = path_rs.file_name() {
if let Some(utf8) = basename.to_str() {
Ok(utf8.to_string())
} else {
return Err(mlua::Error::external(anyhow!(
"path entry {} is not representable as utf8",
path.display()
path_rs.display()
)));
}
} else {
Expand Down

0 comments on commit 8bde97d

Please sign in to comment.