mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
refactor: fix clippy warns
I know this is out of the scope of this current PRs, but these minor clippy warnings have been a bit annoying to look at lately, so I've gone ahead and fixed them! :)
This commit is contained in:
parent
e7cbd93b40
commit
8c16abd6b1
3 changed files with 7 additions and 4 deletions
|
@ -231,7 +231,7 @@ pub fn pretty_format_luau_error(e: &LuaError, colorized: bool) -> String {
|
||||||
let mut found_stack_begin = false;
|
let mut found_stack_begin = false;
|
||||||
for (index, line) in err_lines.clone().iter().enumerate().rev() {
|
for (index, line) in err_lines.clone().iter().enumerate().rev() {
|
||||||
if *line == "stack traceback:" {
|
if *line == "stack traceback:" {
|
||||||
err_lines[index] = stack_begin.clone();
|
err_lines[index].clone_from(&stack_begin);
|
||||||
found_stack_begin = true;
|
found_stack_begin = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ use super::formatting::format_label;
|
||||||
use crate::RuntimeError;
|
use crate::RuntimeError;
|
||||||
|
|
||||||
pub trait LuaEmitErrorExt {
|
pub trait LuaEmitErrorExt {
|
||||||
|
#[allow(dead_code)]
|
||||||
fn emit_error(&self, err: LuaError);
|
fn emit_error(&self, err: LuaError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,13 @@ pub fn add_methods<'lua, M: LuaUserDataMethods<'lua, Instance>>(methods: &mut M)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_or_create_material_colors(instance: &Instance) -> MaterialColors {
|
fn get_or_create_material_colors(instance: &Instance) -> MaterialColors {
|
||||||
if let Some(Variant::MaterialColors(material_colors)) = instance.get_property("MaterialColors")
|
if let Variant::MaterialColors(inner) = instance
|
||||||
|
.get_property("MaterialColors")
|
||||||
|
.unwrap_or(Variant::MaterialColors(MaterialColors::default()))
|
||||||
{
|
{
|
||||||
material_colors
|
inner
|
||||||
} else {
|
} else {
|
||||||
MaterialColors::default()
|
unreachable!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue