From ff821351b8f7f2c7031a6824181e42f4c06248e6 Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Sun, 28 Apr 2024 18:10:35 +0800 Subject: [PATCH] try to update nushell on latest main --- Cargo.lock | 53 +++++++++++++++++++++++++++++++++---------------- Cargo.toml | 6 +++--- src/nu/value.rs | 9 ++++++--- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 675a39d..01821fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1030,7 +1030,7 @@ dependencies = [ [[package]] name = "nu-engine" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "nu-glob", "nu-path", @@ -1041,12 +1041,12 @@ dependencies = [ [[package]] name = "nu-glob" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" [[package]] name = "nu-parser" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "bytesize", "chrono", @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "nu-path" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "dirs-next", "omnipath", @@ -1071,30 +1071,49 @@ dependencies = [ [[package]] name = "nu-plugin" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ - "bincode", - "interprocess", "log", - "miette", "nix", "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "thiserror", +] + +[[package]] +name = "nu-plugin-core" +version = "0.92.3" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", "nu-protocol", - "nu-system", - "nu-utils", "rmp-serde", - "semver", "serde", "serde_json", - "thiserror", - "typetag", "windows 0.54.0", ] +[[package]] +name = "nu-plugin-protocol" +version = "0.92.3" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" +dependencies = [ + "bincode", + "nu-protocol", + "nu-utils", + "semver", + "serde", + "typetag", +] + [[package]] name = "nu-protocol" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "brotli", "byte-unit", @@ -1118,7 +1137,7 @@ dependencies = [ [[package]] name = "nu-system" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "chrono", "libc", @@ -1136,7 +1155,7 @@ dependencies = [ [[package]] name = "nu-utils" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "crossterm_winapi", "log", @@ -1185,7 +1204,7 @@ dependencies = [ [[package]] name = "nuon" version = "0.92.3" -source = "git+https://github.com/nushell/nushell?rev=2595f31541554c6d8602ebebc9dffbc4dd29dd89#2595f31541554c6d8602ebebc9dffbc4dd29dd89" +source = "git+https://github.com/nushell/nushell?rev=59ee96c70d2aa2d1d24d364eebe9c711700e3155#59ee96c70d2aa2d1d24d364eebe9c711700e3155" dependencies = [ "fancy-regex", "nu-engine", diff --git a/Cargo.toml b/Cargo.toml index 9e0c572..aa9e5bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,9 @@ name = "nu_plugin_explore" anyhow = "1.0.73" console = "0.15.7" crossterm = "0.27.0" -nuon = { git = "https://github.com/nushell/nushell", rev = "2595f31541554c6d8602ebebc9dffbc4dd29dd89", package = "nuon" } -nu-plugin = { git = "https://github.com/nushell/nushell", rev = "2595f31541554c6d8602ebebc9dffbc4dd29dd89", package = "nu-plugin" } -nu-protocol = { git = "https://github.com/nushell/nushell", rev = "2595f31541554c6d8602ebebc9dffbc4dd29dd89", package = "nu-protocol", features = ["plugin"] } +nuon = { git = "https://github.com/nushell/nushell", rev = "59ee96c70d2aa2d1d24d364eebe9c711700e3155", package = "nuon" } +nu-plugin = { git = "https://github.com/nushell/nushell", rev = "59ee96c70d2aa2d1d24d364eebe9c711700e3155", package = "nu-plugin" } +nu-protocol = { git = "https://github.com/nushell/nushell", rev = "59ee96c70d2aa2d1d24d364eebe9c711700e3155", package = "nu-protocol", features = ["plugin"] } ratatui = "0.26.1" url = "2.4.0" diff --git a/src/nu/value.rs b/src/nu/value.rs index 1cb20a4..d93b4e4 100644 --- a/src/nu/value.rs +++ b/src/nu/value.rs @@ -136,9 +136,12 @@ pub(crate) fn is_table(value: &Value) -> Table { let mut rows = Vec::new(); for (i, val) in vals.iter().enumerate() { match val.get_type() { - Type::Record(fields) => { - rows.push(fields.into_iter().collect::>()) - } + Type::Record(fields) => rows.push( + fields + .into_iter() + .cloned() + .collect::>(), + ), t => return Table::RowNotARecord(i, t), }; }