mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 14:06:40 +02:00
Rust 1.85, edition=2024 (#15741)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
authors = ["The Nushell Project Developers"]
|
||||
description = "Protocol type definitions for Nushell plugins"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-protocol"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-plugin-protocol"
|
||||
version = "0.104.1"
|
||||
@ -24,4 +24,4 @@ typetag = "0.2"
|
||||
|
||||
[features]
|
||||
default = ["local-socket"]
|
||||
local-socket = []
|
||||
local-socket = []
|
||||
|
@ -1,7 +1,8 @@
|
||||
use nu_protocol::{
|
||||
FromValue, ShellError, Span, Spanned, Value,
|
||||
ast::{self, Expression},
|
||||
engine::{Call, CallImpl, EngineState, Stack},
|
||||
ir, FromValue, ShellError, Span, Spanned, Value,
|
||||
ir,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -22,9 +22,9 @@ mod tests;
|
||||
pub mod test_util;
|
||||
|
||||
use nu_protocol::{
|
||||
ast::Operator, engine::Closure, ByteStreamType, Config, DeclId, LabeledError, PipelineData,
|
||||
PipelineMetadata, PluginMetadata, PluginSignature, ShellError, SignalAction, Span, Spanned,
|
||||
Value,
|
||||
ByteStreamType, Config, DeclId, LabeledError, PipelineData, PipelineMetadata, PluginMetadata,
|
||||
PluginSignature, ShellError, SignalAction, Span, Spanned, Value, ast::Operator,
|
||||
engine::Closure,
|
||||
};
|
||||
use nu_utils::SharedCow;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use nu_protocol::{ast::Operator, CustomValue, ShellError, Span, Value};
|
||||
use nu_protocol::{CustomValue, ShellError, Span, Value, ast::Operator};
|
||||
use nu_utils::SharedCow;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -169,7 +169,7 @@ impl PluginCustomValue {
|
||||
value.recurse_mut(&mut |value| {
|
||||
let span = value.span();
|
||||
match value {
|
||||
Value::Custom { ref val, .. } => {
|
||||
Value::Custom { val, .. } => {
|
||||
if val.as_any().downcast_ref::<PluginCustomValue>().is_some() {
|
||||
// Already a PluginCustomValue
|
||||
Ok(())
|
||||
@ -190,7 +190,7 @@ impl PluginCustomValue {
|
||||
value.recurse_mut(&mut |value| {
|
||||
let span = value.span();
|
||||
match value {
|
||||
Value::Custom { ref val, .. } => {
|
||||
Value::Custom { val, .. } => {
|
||||
if let Some(val) = val.as_any().downcast_ref::<PluginCustomValue>() {
|
||||
let deserialized = val.deserialize_to_custom_value(span)?;
|
||||
*value = Value::custom(deserialized, span);
|
||||
@ -210,7 +210,7 @@ impl PluginCustomValue {
|
||||
value.recurse_mut(&mut |value| {
|
||||
let span = value.span();
|
||||
match value {
|
||||
Value::Custom { ref val, .. } => {
|
||||
Value::Custom { val, .. } => {
|
||||
*value = val.to_base_value(span)?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::test_util::{expected_test_custom_value, test_plugin_custom_value, TestCustomValue};
|
||||
use crate::test_util::{TestCustomValue, expected_test_custom_value, test_plugin_custom_value};
|
||||
|
||||
use super::PluginCustomValue;
|
||||
use nu_protocol::{engine::Closure, record, BlockId, CustomValue, ShellError, Span, Value, VarId};
|
||||
use nu_protocol::{BlockId, CustomValue, ShellError, Span, Value, VarId, engine::Closure, record};
|
||||
|
||||
fn check_record_custom_values(
|
||||
val: &Value,
|
||||
|
Reference in New Issue
Block a user