Fix lints

This commit is contained in:
Filip Tibell 2023-10-21 11:41:09 +02:00
parent 4e68c64daf
commit 7e9aaeafe6
No known key found for this signature in database
3 changed files with 6 additions and 7 deletions

View file

@ -74,7 +74,6 @@ dunce = "1.0"
lz4_flex = "0.11" lz4_flex = "0.11"
path-clean = "1.0" path-clean = "1.0"
pin-project = "1.0" pin-project = "1.0"
os_str_bytes = "6.4"
urlencoding = "2.1" urlencoding = "2.1"
### RUNTIME ### RUNTIME
@ -83,6 +82,7 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] }
mlua = { version = "0.9.1", features = ["luau", "luau-jit", "serialize"] } mlua = { version = "0.9.1", features = ["luau", "luau-jit", "serialize"] }
tokio = { version = "1.24", features = ["full", "tracing"] } tokio = { version = "1.24", features = ["full", "tracing"] }
os_str_bytes = { version = "6.4", features = ["conversions"] }
### SERDE ### SERDE

View file

@ -38,9 +38,8 @@ pub async fn find_lune_scripts(in_home_dir: bool) -> Result<Vec<(String, String)
bail!("Failed to cast path to string slice.") bail!("Failed to cast path to string slice.")
}; };
let init_file_path = match discover_script_path(dir_path, in_home_dir) { let Ok(init_file_path) = discover_script_path(dir_path, in_home_dir) else {
Ok(init_file) => init_file, continue;
_ => continue,
}; };
let contents = fs::read(init_file_path).await?; let contents = fs::read(init_file_path).await?;

View file

@ -99,7 +99,7 @@ fn process_env_get<'lua>(
Some(value) => { Some(value) => {
let raw_value = RawOsString::new(value); let raw_value = RawOsString::new(value);
Ok(LuaValue::String( Ok(LuaValue::String(
lua.create_string(raw_value.as_raw_bytes())?, lua.create_string(raw_value.to_raw_bytes())?,
)) ))
} }
None => Ok(LuaValue::Nil), None => Ok(LuaValue::Nil),
@ -152,8 +152,8 @@ fn process_env_iter<'lua>(
let raw_key = RawOsString::new(key); let raw_key = RawOsString::new(key);
let raw_value = RawOsString::new(value); let raw_value = RawOsString::new(value);
Ok(( Ok((
LuaValue::String(lua.create_string(raw_key.as_raw_bytes())?), LuaValue::String(lua.create_string(raw_key.to_raw_bytes())?),
LuaValue::String(lua.create_string(raw_value.as_raw_bytes())?), LuaValue::String(lua.create_string(raw_value.to_raw_bytes())?),
)) ))
} }
None => Ok((LuaValue::Nil, LuaValue::Nil)), None => Ok((LuaValue::Nil, LuaValue::Nil)),