Skip to content

Commit a9a8a19

Browse files
committed
refactor: upgrade to mlua v0.10.0 (sxyazi#1842)
1 parent baf062f commit a9a8a19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+673
-658
lines changed

Cargo.lock

Lines changed: 21 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ strip = true
1111

1212
[workspace.dependencies]
1313
ansi-to-tui = "7.0.0"
14-
anyhow = "1.0.92"
14+
anyhow = "1.0.93"
1515
base64 = "0.22.1"
1616
bitflags = "2.6.0"
1717
clap = { version = "4.5.20", features = [ "derive" ] }
1818
crossterm = { version = "0.28.1", features = [ "event-stream" ] }
1919
dirs = "5.0.1"
2020
futures = "0.3.31"
2121
globset = "0.4.15"
22-
libc = "0.2.161"
22+
libc = "0.2.162"
2323
md-5 = "0.10.6"
24-
mlua = { version = "0.9.9", features = [ "lua54", "serialize", "macros", "async" ] }
24+
mlua = { git = "https://github.com/mlua-rs/mlua.git", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
2525
parking_lot = "0.12.3"
2626
ratatui = { version = "0.29.0", features = [ "unstable-rendered-line-info" ] }
2727
regex = "1.11.1"
2828
scopeguard = "1.2.0"
2929
serde = { version = "1.0.214", features = [ "derive" ] }
3030
serde_json = "1.0.132"
3131
shell-words = "1.1.0"
32-
tokio = { version = "1.41.0", features = [ "full" ] }
32+
tokio = { version = "1.41.1", features = [ "full" ] }
3333
tokio-stream = "0.1.16"
3434
tokio-util = "0.7.12"
3535
tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_level_warn" ] }

nix/yazi-unwrapped.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ rustPlatform.buildRustPackage rec {
2929

3030
cargoLock = {
3131
lockFile = "${src}/Cargo.lock";
32-
# outputHashes = {
33-
# "notify-6.1.1" = "sha256-5Ft2yvRPi2EaErcGBkF/3Xv6K7ijFGbdjmSqI4go/h4=";
34-
# };
32+
outputHashes = {
33+
"mlua-0.10.0" = "sha256-Xg6/jc+UP8tbJJ6x1sbAgt8ZHt051xEBBcjmikQqYlw=";
34+
};
3535
};
3636

3737
env = {

yazi-dds/src/body/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a> Body<'a> {
107107
pub fn with_sender(self, sender: u64) -> Payload<'a> { Payload::new(self).with_sender(sender) }
108108
}
109109

110-
impl IntoLua<'_> for Body<'static> {
110+
impl IntoLua for Body<'static> {
111111
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
112112
match self {
113113
Self::Hi(b) => b.into_lua(lua),

yazi-dds/src/body/bulk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a> From<BodyBulk<'a>> for Body<'a> {
3636
fn from(value: BodyBulk<'a>) -> Self { Self::Bulk(value) }
3737
}
3838

39-
impl IntoLua<'_> for BodyBulk<'static> {
39+
impl IntoLua for BodyBulk<'static> {
4040
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
4141
BodyBulkIter { inner: self.changes.into_iter() }.into_lua(lua)
4242
}
@@ -48,7 +48,7 @@ pub struct BodyBulkIter {
4848
}
4949

5050
impl UserData for BodyBulkIter {
51-
fn add_methods<'lua, M: mlua::UserDataMethods<'lua, Self>>(methods: &mut M) {
51+
fn add_methods<M: mlua::UserDataMethods<Self>>(methods: &mut M) {
5252
methods.add_meta_method(MetaMethod::Len, |_, me, ()| Ok(me.inner.len()));
5353

5454
methods.add_meta_function(MetaMethod::Pairs, |lua, me: AnyUserData| {

yazi-dds/src/body/bye.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ impl<'a> From<BodyBye> for Body<'a> {
1515
fn from(value: BodyBye) -> Self { Self::Bye(value) }
1616
}
1717

18-
impl IntoLua<'_> for BodyBye {
19-
fn into_lua(self, _: &Lua) -> mlua::Result<Value<'_>> {
18+
impl IntoLua for BodyBye {
19+
fn into_lua(self, _: &Lua) -> mlua::Result<Value> {
2020
Err("BodyBye cannot be converted to Lua").into_lua_err()
2121
}
2222
}

yazi-dds/src/body/cd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a> From<BodyCd<'a>> for Body<'a> {
3232
fn from(value: BodyCd<'a>) -> Self { Self::Cd(value) }
3333
}
3434

35-
impl IntoLua<'_> for BodyCd<'static> {
35+
impl IntoLua for BodyCd<'static> {
3636
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
3737
if let Some(Cow::Owned(url)) = Some(self.url).filter(|_| !self.dummy) {
3838
lua.create_table_from([

yazi-dds/src/body/custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl From<BodyCustom> for Body<'_> {
2727
fn from(value: BodyCustom) -> Self { Self::Custom(value) }
2828
}
2929

30-
impl IntoLua<'_> for BodyCustom {
30+
impl IntoLua for BodyCustom {
3131
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> { Sendable::data_to_value(lua, self.data) }
3232
}
3333

yazi-dds/src/body/delete.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ impl<'a> From<BodyDelete<'a>> for Body<'a> {
2525
fn from(value: BodyDelete<'a>) -> Self { Self::Delete(value) }
2626
}
2727

28-
impl IntoLua<'_> for BodyDelete<'static> {
29-
fn into_lua(self, lua: &Lua) -> mlua::Result<Value<'_>> {
28+
impl IntoLua for BodyDelete<'static> {
29+
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
3030
let urls = lua.create_table_with_capacity(self.urls.len(), 0)?;
3131

3232
// In most cases, `self.urls` will be `Cow::Owned`, so

yazi-dds/src/body/hey.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ impl From<BodyHey> for Body<'_> {
2323
fn from(value: BodyHey) -> Self { Self::Hey(value) }
2424
}
2525

26-
impl IntoLua<'_> for BodyHey {
27-
fn into_lua(self, _: &Lua) -> mlua::Result<Value<'_>> {
26+
impl IntoLua for BodyHey {
27+
fn into_lua(self, _: &Lua) -> mlua::Result<Value> {
2828
Err("BodyHey cannot be converted to Lua").into_lua_err()
2929
}
3030
}

0 commit comments

Comments
 (0)