diff --git a/crates/nu-protocol/src/value/from_value.rs b/crates/nu-protocol/src/value/from_value.rs index 642d032a5f..2a384d33c4 100644 --- a/crates/nu-protocol/src/value/from_value.rs +++ b/crates/nu-protocol/src/value/from_value.rs @@ -13,15 +13,15 @@ use std::{ }; /// A trait for loading a value from a [`Value`]. -/// +/// /// # Derivable -/// This trait can be used with `#[derive]`. -/// When derived on structs with named fields, it expects a [`Value::Record`] -/// where each field of the struct maps to a corresponding field in the record. -/// For structs with unnamed fields, it expects a [`Value::List`], and the -/// fields are populated in the order they appear in the list. -/// Unit structs expect a [`Value::Nothing`], as they contain no data. -/// Attempting to convert from a non-matching `Value` type will result in an +/// This trait can be used with `#[derive]`. +/// When derived on structs with named fields, it expects a [`Value::Record`] +/// where each field of the struct maps to a corresponding field in the record. +/// For structs with unnamed fields, it expects a [`Value::List`], and the +/// fields are populated in the order they appear in the list. +/// Unit structs expect a [`Value::Nothing`], as they contain no data. +/// Attempting to convert from a non-matching `Value` type will result in an /// error. // TODO: explain derive for enums pub trait FromValue: Sized { diff --git a/crates/nu-protocol/src/value/into_value.rs b/crates/nu-protocol/src/value/into_value.rs index 35994473c6..118d3f9627 100644 --- a/crates/nu-protocol/src/value/into_value.rs +++ b/crates/nu-protocol/src/value/into_value.rs @@ -5,15 +5,15 @@ use crate::{Record, ShellError, Span, Value}; /// A trait for converting a value into a [`Value`]. /// /// This conversion is infallible, for fallible conversions use [`TryIntoValue`]. -/// +/// /// # Derivable -/// This trait can be used with `#[derive]`. -/// When derived on structs with named fields, the resulting value -/// representation will use [`Value::Record`], where each field of the record -/// corresponds to a field of the struct. -/// For structs with unnamed fields, the value representation will be +/// This trait can be used with `#[derive]`. +/// When derived on structs with named fields, the resulting value +/// representation will use [`Value::Record`], where each field of the record +/// corresponds to a field of the struct. +/// For structs with unnamed fields, the value representation will be /// [`Value::List`], with all fields inserted into a list. -/// Unit structs will be represented as [`Value::Nothing`] since they contain +/// Unit structs will be represented as [`Value::Nothing`] since they contain /// no data. // TODO: explain derive for enums pub trait IntoValue: Sized {