allow str from to convert more things to string (#2977)

* allow str from to convert more things to string

* fixed FileSize so it reports with units configured

* added tests
This commit is contained in:
Darren Schroeder
2021-01-29 07:43:35 -06:00
committed by GitHub
parent d0a2a02eea
commit 47c4b8e88a
20 changed files with 638 additions and 441 deletions

View File

@ -8,7 +8,7 @@ use nu_errors::ShellError;
use nu_parser::ParserScope;
use nu_protocol::hir::Block;
use nu_protocol::{ReturnSuccess, Signature, UntaggedValue};
use nu_source::{b, DebugDocBuilder, PrettyDebugWithSource, Span, Tag};
use nu_source::{DbgDocBldr, DebugDocBuilder, PrettyDebugWithSource, Span, Tag};
use nu_stream::{OutputStream, ToOutputStream};
use std::sync::Arc;
@ -172,12 +172,12 @@ pub struct Command(Arc<dyn WholeStreamCommand>);
impl PrettyDebugWithSource for Command {
fn pretty_debug(&self, source: &str) -> DebugDocBuilder {
b::typed(
DbgDocBldr::typed(
"whole stream command",
b::description(self.name())
+ b::space()
+ b::equals()
+ b::space()
DbgDocBldr::description(self.name())
+ DbgDocBldr::space()
+ DbgDocBldr::equals()
+ DbgDocBldr::space()
+ self.signature().pretty_debug(source),
)
}