Make clippy happy

This commit is contained in:
Alex Orlenko 2022-06-28 21:28:45 +01:00
parent 04ba93137c
commit 9af1aaf889
No known key found for this signature in database
GPG key ID: 4C150C250863B96D
3 changed files with 3 additions and 2 deletions

View file

@ -484,7 +484,7 @@ impl<'lua, 'a> Chunk<'lua, 'a> {
return ChunkMode::Binary;
}
#[cfg(feature = "luau")]
if *source.get(0).unwrap_or(&u8::MAX) < b'\n' {
if *source.first().unwrap_or(&u8::MAX) < b'\n' {
return ChunkMode::Binary;
}
ChunkMode::Text

View file

@ -2870,7 +2870,7 @@ impl Lua {
let _sg = StackGuard::new(state);
assert_stack(state, 1);
let extra = extra_data(state)?;
let inner = &*(*extra.get()).inner.as_ref().unwrap();
let inner = (*extra.get()).inner.as_ref().unwrap();
Some(Lua(Arc::clone(inner)))
}

View file

@ -597,6 +597,7 @@ impl<'lua, 'scope> Drop for Scope<'lua, 'scope> {
}
}
#[allow(clippy::type_complexity)]
enum NonStaticMethod<'lua, T> {
Method(Box<dyn Fn(&'lua Lua, &T, MultiValue<'lua>) -> Result<MultiValue<'lua>>>),
MethodMut(Box<dyn FnMut(&'lua Lua, &mut T, MultiValue<'lua>) -> Result<MultiValue<'lua>>>),