Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kongsgaard authored and Daniel Kongsgaard committed Oct 28, 2023
1 parent 22946b8 commit b49a618
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua-api-crates/filesystem/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ impl UserData for Path {
)))?);
Ok(Path(PathBuf::from(&p)))
});
methods.add_meta_method(MetaMethod::Eq, |_, this, maybe_path: LuaValue| {
match maybe_path {
methods.add_meta_method(
MetaMethod::Eq,
|_, this, maybe_path: LuaValue| match maybe_path {
LuaValue::UserData(u) => {
let p = u.borrow::<Path>();
match p {
Expand All @@ -84,8 +85,8 @@ impl UserData for Path {
}
LuaValue::Error(e) => Err(mlua::Error::external(e)),
_ => Ok(false),
}
});
},
);
// TODO: Should these be included here too? They are not async.
// methods.add_method("is_dir", |_, this, _: ()| {
// let b = this.0.is_dir();
Expand Down

0 comments on commit b49a618

Please sign in to comment.