mirror of
https://github.com/lune-org/lune.git
synced 2025-03-31 08:30:56 +01:00
Fix various new clippy lints
This commit is contained in:
parent
dc08b91314
commit
6902ecaa7c
8 changed files with 12 additions and 12 deletions
|
@ -41,7 +41,7 @@ where
|
|||
}
|
||||
|
||||
fn remove_matching_prop(inst: &mut DomInstance, ty: DomType, name: &'static str) {
|
||||
if inst.properties.get(name).map_or(false, |u| u.ty() == ty) {
|
||||
if inst.properties.get(name).is_some_and(|u| u.ty() == ty) {
|
||||
inst.properties.remove(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn make_list_writer() -> Box<ListWriter> {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Userdata metamethod implementations
|
||||
|
||||
Note that many of these return [`LuaResult`] even though they don't
|
||||
|
|
|
@ -60,7 +60,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Conversion methods between `DateTimeValues` and plain lua tables
|
||||
|
||||
Note that the `IntoLua` implementation here uses a read-only table,
|
||||
|
@ -117,7 +117,7 @@ impl IntoLua<'_> for DateTimeValues {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Conversion methods between chrono's timezone-aware `DateTime` to
|
||||
and from our non-timezone-aware `DateTimeValues` values struct
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, W> AsyncWrite for AsyncTeeWriter<'a, W>
|
||||
impl<W> AsyncWrite for AsyncTeeWriter<'_, W>
|
||||
where
|
||||
W: AsyncWrite + Unpin,
|
||||
{
|
||||
|
|
|
@ -117,7 +117,7 @@ impl<'lua> FromLua<'lua> for CompressDecompressFormat {
|
|||
|
||||
Errors when the compression fails.
|
||||
*/
|
||||
pub async fn compress<'lua>(
|
||||
pub async fn compress(
|
||||
source: impl AsRef<[u8]>,
|
||||
format: CompressDecompressFormat,
|
||||
level: Option<i32>,
|
||||
|
@ -163,7 +163,7 @@ pub async fn compress<'lua>(
|
|||
|
||||
Errors when the decompression fails.
|
||||
*/
|
||||
pub async fn decompress<'lua>(
|
||||
pub async fn decompress(
|
||||
source: impl AsRef<[u8]>,
|
||||
format: CompressDecompressFormat,
|
||||
) -> LuaResult<Vec<u8>> {
|
||||
|
|
|
@ -150,9 +150,9 @@ impl RequireContext {
|
|||
self.get_from_cache(lua, abs_path.as_ref())
|
||||
}
|
||||
|
||||
async fn load<'lua>(
|
||||
async fn load(
|
||||
&self,
|
||||
lua: &'lua Lua,
|
||||
lua: &Lua,
|
||||
abs_path: impl AsRef<Path>,
|
||||
rel_path: impl AsRef<Path>,
|
||||
) -> LuaResult<LuaRegistryKey> {
|
||||
|
|
|
@ -64,8 +64,8 @@ pub fn discover_script_path(path: impl AsRef<str>, in_home_dir: bool) -> Result<
|
|||
// NOTE: We use metadata directly here to try to
|
||||
// avoid accessing the file path more than once
|
||||
let file_meta = file_path.metadata();
|
||||
let is_file = file_meta.as_ref().map_or(false, Metadata::is_file);
|
||||
let is_dir = file_meta.as_ref().map_or(false, Metadata::is_dir);
|
||||
let is_file = file_meta.as_ref().is_ok_and(Metadata::is_file);
|
||||
let is_dir = file_meta.as_ref().is_ok_and(Metadata::is_dir);
|
||||
let is_abs = file_path.is_absolute();
|
||||
let ext = file_path.extension();
|
||||
if is_file {
|
||||
|
|
|
@ -334,7 +334,7 @@ impl<'lua> LuaSchedulerExt<'lua> for Lua {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'lua> LuaSpawnExt<'lua> for Lua {
|
||||
impl LuaSpawnExt<'_> for Lua {
|
||||
fn spawn<F, T>(&self, fut: F) -> Task<T>
|
||||
where
|
||||
F: Future<Output = T> + Send + 'static,
|
||||
|
|
Loading…
Add table
Reference in a new issue