From c87fa14fc8e2b08d3f5d7e5580b289d8d10a2559 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 29 Aug 2019 13:08:28 +0200 Subject: [PATCH] Replace crate visibility identifier with pub(crate) Result of running: find src -name *.rs -exec sed -i 's/crate /pub(crate) /g' {} \; --- src/cli.rs | 2 +- src/commands.rs | 230 ++++++++++++++++----------------- src/commands/classified.rs | 40 +++--- src/commands/format.rs | 2 +- src/context.rs | 22 ++-- src/env.rs | 4 +- src/env/host.rs | 2 +- src/errors.rs | 28 ++-- src/evaluate/evaluator.rs | 6 +- src/evaluate/mod.rs | 4 +- src/format.rs | 22 ++-- src/format/entries.rs | 2 +- src/object.rs | 22 ++-- src/object/base.rs | 54 ++++---- src/object/config.rs | 6 +- src/object/dict.rs | 4 +- src/object/files.rs | 2 +- src/object/meta.rs | 6 +- src/object/process.rs | 2 +- src/parser.rs | 38 +++--- src/parser/hir.rs | 42 +++--- src/parser/hir/named.rs | 2 +- src/parser/parse.rs | 24 ++-- src/parser/parse/pipeline.rs | 4 +- src/parser/parse/token_tree.rs | 2 +- src/parser/parse/unit.rs | 2 +- src/parser/registry.rs | 14 +- src/prelude.rs | 56 ++++---- src/shell.rs | 14 +- src/shell/completer.rs | 2 +- src/shell/filesystem_shell.rs | 2 +- src/shell/helper.rs | 4 +- src/shell/shell_manager.rs | 4 +- src/shell/value_shell.rs | 4 +- src/stream.rs | 4 +- 35 files changed, 339 insertions(+), 339 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index fc10dc0d0..6cbb0c189 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -7,7 +7,7 @@ use crate::commands::plugin::JsonRpc; use crate::commands::plugin::{PluginCommand, PluginSink}; use crate::commands::whole_stream_command; use crate::context::Context; -crate use crate::errors::ShellError; +pub(crate) use crate::errors::ShellError; use crate::git::current_branch; use crate::object::Value; use crate::parser::registry::Signature; diff --git a/src/commands.rs b/src/commands.rs index eb5d29b7b..12cd6d56e 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,121 +1,121 @@ #[macro_use] -crate mod macros; +pub(crate) mod macros; -crate mod args; -crate mod autoview; -crate mod cd; -crate mod classified; -crate mod clip; -crate mod command; -crate mod config; -crate mod cp; -crate mod date; -crate mod debug; -crate mod enter; -crate mod exit; -crate mod first; -crate mod from_array; -crate mod from_bson; -crate mod from_csv; -crate mod from_ini; -crate mod from_json; -crate mod from_toml; -crate mod from_tsv; -crate mod from_xml; -crate mod from_yaml; -crate mod get; -crate mod last; -crate mod lines; -crate mod ls; -crate mod mkdir; -crate mod mv; -crate mod next; -crate mod nth; -crate mod open; -crate mod pick; -crate mod plugin; -crate mod prev; -crate mod ps; -crate mod reject; -crate mod reverse; -crate mod rm; -crate mod save; -crate mod shells; -crate mod size; -crate mod skip_while; -crate mod sort_by; -crate mod split_column; -crate mod split_row; -crate mod table; -crate mod tags; -crate mod to_array; -crate mod to_bson; -crate mod to_csv; -crate mod to_json; -crate mod to_toml; -crate mod to_tsv; -crate mod to_yaml; -crate mod trim; -crate mod version; -crate mod vtable; -crate mod where_; -crate mod which_; +pub(crate) mod args; +pub(crate) mod autoview; +pub(crate) mod cd; +pub(crate) mod classified; +pub(crate) mod clip; +pub(crate) mod command; +pub(crate) mod config; +pub(crate) mod cp; +pub(crate) mod date; +pub(crate) mod debug; +pub(crate) mod enter; +pub(crate) mod exit; +pub(crate) mod first; +pub(crate) mod from_array; +pub(crate) mod from_bson; +pub(crate) mod from_csv; +pub(crate) mod from_ini; +pub(crate) mod from_json; +pub(crate) mod from_toml; +pub(crate) mod from_tsv; +pub(crate) mod from_xml; +pub(crate) mod from_yaml; +pub(crate) mod get; +pub(crate) mod last; +pub(crate) mod lines; +pub(crate) mod ls; +pub(crate) mod mkdir; +pub(crate) mod mv; +pub(crate) mod next; +pub(crate) mod nth; +pub(crate) mod open; +pub(crate) mod pick; +pub(crate) mod plugin; +pub(crate) mod prev; +pub(crate) mod ps; +pub(crate) mod reject; +pub(crate) mod reverse; +pub(crate) mod rm; +pub(crate) mod save; +pub(crate) mod shells; +pub(crate) mod size; +pub(crate) mod skip_while; +pub(crate) mod sort_by; +pub(crate) mod split_column; +pub(crate) mod split_row; +pub(crate) mod table; +pub(crate) mod tags; +pub(crate) mod to_array; +pub(crate) mod to_bson; +pub(crate) mod to_csv; +pub(crate) mod to_json; +pub(crate) mod to_toml; +pub(crate) mod to_tsv; +pub(crate) mod to_yaml; +pub(crate) mod trim; +pub(crate) mod version; +pub(crate) mod vtable; +pub(crate) mod where_; +pub(crate) mod which_; -crate use autoview::Autoview; -crate use cd::CD; -crate use command::{ +pub(crate) use autoview::Autoview; +pub(crate) use cd::CD; +pub(crate) use command::{ per_item_command, whole_stream_command, Command, PerItemCommand, RawCommandArgs, UnevaluatedCallInfo, WholeStreamCommand, }; -crate use config::Config; -crate use cp::Cpy; -crate use date::Date; -crate use debug::Debug; -crate use enter::Enter; -crate use exit::Exit; -crate use first::First; -crate use from_array::FromArray; -crate use from_bson::FromBSON; -crate use from_csv::FromCSV; -crate use from_ini::FromINI; -crate use from_json::FromJSON; -crate use from_toml::FromTOML; -crate use from_tsv::FromTSV; -crate use from_xml::FromXML; -crate use from_yaml::FromYAML; -crate use get::Get; -crate use last::Last; -crate use lines::Lines; -crate use ls::LS; -crate use mkdir::Mkdir; -crate use mv::Move; -crate use next::Next; -crate use nth::Nth; -crate use open::Open; -crate use pick::Pick; -crate use prev::Previous; -crate use ps::PS; -crate use reject::Reject; -crate use reverse::Reverse; -crate use rm::Remove; -crate use save::Save; -crate use shells::Shells; -crate use size::Size; -crate use skip_while::SkipWhile; -crate use sort_by::SortBy; -crate use split_column::SplitColumn; -crate use split_row::SplitRow; -crate use table::Table; -crate use tags::Tags; -crate use to_array::ToArray; -crate use to_bson::ToBSON; -crate use to_csv::ToCSV; -crate use to_json::ToJSON; -crate use to_toml::ToTOML; -crate use to_tsv::ToTSV; -crate use to_yaml::ToYAML; -crate use trim::Trim; -crate use version::Version; -crate use vtable::VTable; -crate use where_::Where; -crate use which_::Which; +pub(crate) use config::Config; +pub(crate) use cp::Cpy; +pub(crate) use date::Date; +pub(crate) use debug::Debug; +pub(crate) use enter::Enter; +pub(crate) use exit::Exit; +pub(crate) use first::First; +pub(crate) use from_array::FromArray; +pub(crate) use from_bson::FromBSON; +pub(crate) use from_csv::FromCSV; +pub(crate) use from_ini::FromINI; +pub(crate) use from_json::FromJSON; +pub(crate) use from_toml::FromTOML; +pub(crate) use from_tsv::FromTSV; +pub(crate) use from_xml::FromXML; +pub(crate) use from_yaml::FromYAML; +pub(crate) use get::Get; +pub(crate) use last::Last; +pub(crate) use lines::Lines; +pub(crate) use ls::LS; +pub(crate) use mkdir::Mkdir; +pub(crate) use mv::Move; +pub(crate) use next::Next; +pub(crate) use nth::Nth; +pub(crate) use open::Open; +pub(crate) use pick::Pick; +pub(crate) use prev::Previous; +pub(crate) use ps::PS; +pub(crate) use reject::Reject; +pub(crate) use reverse::Reverse; +pub(crate) use rm::Remove; +pub(crate) use save::Save; +pub(crate) use shells::Shells; +pub(crate) use size::Size; +pub(crate) use skip_while::SkipWhile; +pub(crate) use sort_by::SortBy; +pub(crate) use split_column::SplitColumn; +pub(crate) use split_row::SplitRow; +pub(crate) use table::Table; +pub(crate) use tags::Tags; +pub(crate) use to_array::ToArray; +pub(crate) use to_bson::ToBSON; +pub(crate) use to_csv::ToCSV; +pub(crate) use to_json::ToJSON; +pub(crate) use to_toml::ToTOML; +pub(crate) use to_tsv::ToTSV; +pub(crate) use to_yaml::ToYAML; +pub(crate) use trim::Trim; +pub(crate) use version::Version; +pub(crate) use vtable::VTable; +pub(crate) use where_::Where; +pub(crate) use which_::Which; diff --git a/src/commands/classified.rs b/src/commands/classified.rs index f74bab2f0..c0b42d21c 100644 --- a/src/commands/classified.rs +++ b/src/commands/classified.rs @@ -45,27 +45,27 @@ impl Decoder for LinesCodec { } } -crate struct ClassifiedInputStream { - crate objects: InputStream, - crate stdin: Option, +pub(crate) struct ClassifiedInputStream { + pub(crate) objects: InputStream, + pub(crate) stdin: Option, } impl ClassifiedInputStream { - crate fn new() -> ClassifiedInputStream { + pub(crate) fn new() -> ClassifiedInputStream { ClassifiedInputStream { objects: VecDeque::new().into(), stdin: None, } } - crate fn from_input_stream(stream: impl Into) -> ClassifiedInputStream { + pub(crate) fn from_input_stream(stream: impl Into) -> ClassifiedInputStream { ClassifiedInputStream { objects: stream.into(), stdin: None, } } - crate fn from_stdout(stdout: std::fs::File) -> ClassifiedInputStream { + pub(crate) fn from_stdout(stdout: std::fs::File) -> ClassifiedInputStream { ClassifiedInputStream { objects: VecDeque::new().into(), stdin: Some(stdout), @@ -73,11 +73,11 @@ impl ClassifiedInputStream { } } -crate struct ClassifiedPipeline { - crate commands: Vec, +pub(crate) struct ClassifiedPipeline { + pub(crate) commands: Vec, } -crate enum ClassifiedCommand { +pub(crate) enum ClassifiedCommand { #[allow(unused)] Expr(TokenNode), Internal(InternalCommand), @@ -95,14 +95,14 @@ impl ClassifiedCommand { } } -crate struct InternalCommand { - crate command: Arc, - crate name_span: Span, - crate args: hir::Call, +pub(crate) struct InternalCommand { + pub(crate) command: Arc, + pub(crate) name_span: Span, + pub(crate) args: hir::Call, } impl InternalCommand { - crate async fn run( + pub(crate) async fn run( self, context: &mut Context, input: ClassifiedInputStream, @@ -218,21 +218,21 @@ impl InternalCommand { } } -crate struct ExternalCommand { - crate name: String, +pub(crate) struct ExternalCommand { + pub(crate) name: String, #[allow(unused)] - crate name_span: Span, - crate args: Vec>, + pub(crate) name_span: Span, + pub(crate) args: Vec>, } -crate enum StreamNext { +pub(crate) enum StreamNext { Last, External, Internal, } impl ExternalCommand { - crate async fn run( + pub(crate) async fn run( self, context: &mut Context, input: ClassifiedInputStream, diff --git a/src/commands/format.rs b/src/commands/format.rs index 9cbaa20fe..0c4127559 100644 --- a/src/commands/format.rs +++ b/src/commands/format.rs @@ -3,7 +3,7 @@ use crate::{EntriesListView, GenericView, TreeView}; use futures::stream::{self, StreamExt}; use std::sync::{Arc, Mutex}; -crate fn format(input: Vec, host: &mut dyn Host) { +pub(crate) fn format(input: Vec, host: &mut dyn Host) { let last = input.len() - 1; for (i, item) in input.iter().enumerate() { let view = GenericView::new(item); diff --git a/src/context.rs b/src/context.rs index f2b0b8672..5bade25f2 100644 --- a/src/context.rs +++ b/src/context.rs @@ -41,13 +41,13 @@ pub struct CommandRegistry { } impl CommandRegistry { - crate fn empty() -> CommandRegistry { + pub(crate) fn empty() -> CommandRegistry { CommandRegistry { registry: Arc::new(Mutex::new(IndexMap::default())), } } - crate fn get_command(&self, name: &str) -> Option> { + pub(crate) fn get_command(&self, name: &str) -> Option> { let registry = self.registry.lock().unwrap(); registry.get(name).map(|c| c.clone()) @@ -64,7 +64,7 @@ impl CommandRegistry { registry.insert(name.into(), command); } - crate fn names(&self) -> Vec { + pub(crate) fn names(&self) -> Vec { let registry = self.registry.lock().unwrap(); registry.keys().cloned().collect() } @@ -73,17 +73,17 @@ impl CommandRegistry { #[derive(Clone)] pub struct Context { registry: CommandRegistry, - crate source_map: SourceMap, + pub(crate) source_map: SourceMap, host: Arc>, - crate shell_manager: ShellManager, + pub(crate) shell_manager: ShellManager, } impl Context { - crate fn registry(&self) -> &CommandRegistry { + pub(crate) fn registry(&self) -> &CommandRegistry { &self.registry } - crate fn basic() -> Result> { + pub(crate) fn basic() -> Result> { let registry = CommandRegistry::new(); Ok(Context { registry: registry.clone(), @@ -93,7 +93,7 @@ impl Context { }) } - crate fn with_host(&mut self, block: impl FnOnce(&mut dyn Host)) { + pub(crate) fn with_host(&mut self, block: impl FnOnce(&mut dyn Host)) { let mut host = self.host.lock().unwrap(); block(&mut *host) @@ -109,15 +109,15 @@ impl Context { self.source_map.insert(uuid, span_source); } - crate fn has_command(&self, name: &str) -> bool { + pub(crate) fn has_command(&self, name: &str) -> bool { self.registry.has(name) } - crate fn get_command(&self, name: &str) -> Arc { + pub(crate) fn get_command(&self, name: &str) -> Arc { self.registry.get_command(name).unwrap() } - crate fn run_command<'a>( + pub(crate) fn run_command<'a>( &mut self, command: Arc, name_span: Span, diff --git a/src/env.rs b/src/env.rs index 2dd836f1f..e87ee0608 100644 --- a/src/env.rs +++ b/src/env.rs @@ -1,3 +1,3 @@ -crate mod host; +pub(crate) mod host; -crate use self::host::Host; +pub(crate) use self::host::Host; diff --git a/src/env/host.rs b/src/env/host.rs index 3ae79849c..268f87aff 100644 --- a/src/env/host.rs +++ b/src/env/host.rs @@ -73,7 +73,7 @@ impl Host for BasicHost { } } -crate fn handle_unexpected( +pub(crate) fn handle_unexpected( host: &mut dyn Host, func: impl FnOnce(&mut dyn Host) -> Result, ) { diff --git a/src/errors.rs b/src/errors.rs index 0f6d1b0b4..0e2d1ff65 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -73,7 +73,7 @@ impl serde::de::Error for ShellError { } impl ShellError { - crate fn type_error( + pub(crate) fn type_error( expected: impl Into, actual: Tagged>, ) -> ShellError { @@ -84,21 +84,21 @@ impl ShellError { .start() } - crate fn syntax_error(problem: Tagged>) -> ShellError { + pub(crate) fn syntax_error(problem: Tagged>) -> ShellError { ProximateShellError::SyntaxError { problem: problem.map(|p| p.into()), } .start() } - crate fn invalid_command(problem: impl Into) -> ShellError { + pub(crate) fn invalid_command(problem: impl Into) -> ShellError { ProximateShellError::InvalidCommand { command: problem.into(), } .start() } - crate fn coerce_error( + pub(crate) fn coerce_error( left: Tagged>, right: Tagged>, ) -> ShellError { @@ -109,11 +109,11 @@ impl ShellError { .start() } - crate fn missing_property(subpath: Description, expr: Description) -> ShellError { + pub(crate) fn missing_property(subpath: Description, expr: Description) -> ShellError { ProximateShellError::MissingProperty { subpath, expr }.start() } - crate fn missing_value(span: Option, reason: impl Into) -> ShellError { + pub(crate) fn missing_value(span: Option, reason: impl Into) -> ShellError { ProximateShellError::MissingValue { span, reason: reason.into(), @@ -121,7 +121,7 @@ impl ShellError { .start() } - crate fn argument_error( + pub(crate) fn argument_error( command: impl Into, kind: ArgumentError, span: Span, @@ -134,7 +134,7 @@ impl ShellError { .start() } - crate fn parse_error( + pub(crate) fn parse_error( error: nom::Err<(nom5_locate::LocatedSpan<&str>, nom::error::ErrorKind)>, ) -> ShellError { use language_reporting::*; @@ -158,11 +158,11 @@ impl ShellError { } } - crate fn diagnostic(diagnostic: Diagnostic) -> ShellError { + pub(crate) fn diagnostic(diagnostic: Diagnostic) -> ShellError { ProximateShellError::Diagnostic(ShellDiagnostic { diagnostic }).start() } - crate fn to_diagnostic(self) -> Diagnostic { + pub(crate) fn to_diagnostic(self) -> Diagnostic { match self.error { ProximateShellError::String(StringError { title, .. }) => { Diagnostic::new(Severity::Error, title) @@ -309,11 +309,11 @@ impl ShellError { ProximateShellError::String(StringError::new(title.into(), Value::nothing())).start() } - crate fn unimplemented(title: impl Into) -> ShellError { + pub(crate) fn unimplemented(title: impl Into) -> ShellError { ShellError::string(&format!("Unimplemented: {}", title.into())) } - crate fn unexpected(title: impl Into) -> ShellError { + pub(crate) fn unexpected(title: impl Into) -> ShellError { ShellError::string(&format!("Unexpected: {}", title.into())) } } @@ -369,12 +369,12 @@ impl ToDebug for ProximateShellError { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ShellDiagnostic { - crate diagnostic: Diagnostic, + pub(crate) diagnostic: Diagnostic, } impl ShellDiagnostic { #[allow(unused)] - crate fn simple_diagnostic( + pub(crate) fn simple_diagnostic( span: impl Into, source: impl Into, ) -> ShellDiagnostic { diff --git a/src/evaluate/evaluator.rs b/src/evaluate/evaluator.rs index 9d768a46d..d03c39bc7 100644 --- a/src/evaluate/evaluator.rs +++ b/src/evaluate/evaluator.rs @@ -16,14 +16,14 @@ pub struct Scope { } impl Scope { - crate fn empty() -> Scope { + pub(crate) fn empty() -> Scope { Scope { it: Value::nothing().tagged_unknown(), vars: IndexMap::new(), } } - crate fn it_value(value: Tagged) -> Scope { + pub(crate) fn it_value(value: Tagged) -> Scope { Scope { it: value, vars: IndexMap::new(), @@ -31,7 +31,7 @@ impl Scope { } } -crate fn evaluate_baseline_expr( +pub(crate) fn evaluate_baseline_expr( expr: &Expression, registry: &CommandRegistry, scope: &Scope, diff --git a/src/evaluate/mod.rs b/src/evaluate/mod.rs index 09451fbb4..21a3b369d 100644 --- a/src/evaluate/mod.rs +++ b/src/evaluate/mod.rs @@ -1,3 +1,3 @@ -crate mod evaluator; +pub(crate) mod evaluator; -crate use evaluator::{evaluate_baseline_expr, Scope}; +pub(crate) use evaluator::{evaluate_baseline_expr, Scope}; diff --git a/src/format.rs b/src/format.rs index ae43c6f8a..7f6547285 100644 --- a/src/format.rs +++ b/src/format.rs @@ -1,21 +1,21 @@ -crate mod entries; -crate mod generic; -crate mod list; -crate mod table; -crate mod vtable; +pub(crate) mod entries; +pub(crate) mod generic; +pub(crate) mod list; +pub(crate) mod table; +pub(crate) mod vtable; use crate::prelude::*; -crate use entries::EntriesView; +pub(crate) use entries::EntriesView; #[allow(unused)] -crate use generic::GenericView; -crate use table::TableView; -crate use vtable::VTableView; +pub(crate) use generic::GenericView; +pub(crate) use table::TableView; +pub(crate) use vtable::VTableView; -crate trait RenderView { +pub(crate) trait RenderView { fn render_view(&self, host: &mut dyn Host) -> Result<(), ShellError>; } -crate fn print_view(view: &impl RenderView, host: &mut dyn Host) -> Result<(), ShellError> { +pub(crate) fn print_view(view: &impl RenderView, host: &mut dyn Host) -> Result<(), ShellError> { view.render_view(host) } diff --git a/src/format/entries.rs b/src/format/entries.rs index 67855beed..db0cb52c8 100644 --- a/src/format/entries.rs +++ b/src/format/entries.rs @@ -14,7 +14,7 @@ pub struct EntriesView { } impl EntriesView { - crate fn from_value(value: &Value) -> EntriesView { + pub(crate) fn from_value(value: &Value) -> EntriesView { let descs = value.data_descriptors(); let mut entries = vec![]; diff --git a/src/object.rs b/src/object.rs index 8cc86d456..743a09cf6 100644 --- a/src/object.rs +++ b/src/object.rs @@ -1,13 +1,13 @@ -crate mod base; -crate mod config; -crate mod dict; -crate mod files; -crate mod into; -crate mod meta; -crate mod process; -crate mod types; +pub(crate) mod base; +pub(crate) mod config; +pub(crate) mod dict; +pub(crate) mod files; +pub(crate) mod into; +pub(crate) mod meta; +pub(crate) mod process; +pub(crate) mod types; #[allow(unused)] -crate use base::{Block, Primitive, Switch, Value}; -crate use dict::{Dictionary, TaggedDictBuilder}; -crate use files::dir_entry_dict; +pub(crate) use base::{Block, Primitive, Switch, Value}; +pub(crate) use dict::{Dictionary, TaggedDictBuilder}; +pub(crate) use files::dir_entry_dict; diff --git a/src/object/base.rs b/src/object/base.rs index b8c1a277e..a9a485f9f 100644 --- a/src/object/base.rs +++ b/src/object/base.rs @@ -16,11 +16,11 @@ use std::time::SystemTime; #[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq, new, Serialize, Deserialize)] pub struct OF64 { - crate inner: OrderedFloat, + pub(crate) inner: OrderedFloat, } impl OF64 { - crate fn into_inner(&self) -> f64 { + pub(crate) fn into_inner(&self) -> f64 { self.inner.into_inner() } } @@ -49,7 +49,7 @@ pub enum Primitive { } impl Primitive { - crate fn type_name(&self) -> String { + pub(crate) fn type_name(&self) -> String { use Primitive::*; match self { @@ -67,7 +67,7 @@ impl Primitive { .to_string() } - crate fn debug(&self, f: &mut fmt::Formatter) -> fmt::Result { + pub(crate) fn debug(&self, f: &mut fmt::Formatter) -> fmt::Result { use Primitive::*; match self { @@ -130,16 +130,16 @@ impl Primitive { #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone, new, Serialize)] pub struct Operation { - crate left: Value, - crate operator: Operator, - crate right: Value, + pub(crate) left: Value, + pub(crate) operator: Operator, + pub(crate) right: Value, } #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone, Serialize, Deserialize, new)] pub struct Block { - crate expressions: Vec, - crate source: Text, - crate span: Span, + pub(crate) expressions: Vec, + pub(crate) source: Text, + pub(crate) span: Span, } impl Block { @@ -209,7 +209,7 @@ impl fmt::Debug for ValueDebug<'a> { } impl Tagged { - crate fn tagged_type_name(&self) -> Tagged { + pub(crate) fn tagged_type_name(&self) -> Tagged { let name = self.type_name(); Tagged::from_item(name, self.tag()) } @@ -319,13 +319,13 @@ impl std::convert::TryFrom>> for Switch { } impl Tagged { - crate fn debug(&'a self) -> ValueDebug<'a> { + pub(crate) fn debug(&'a self) -> ValueDebug<'a> { ValueDebug { value: self } } } impl Value { - crate fn type_name(&self) -> String { + pub(crate) fn type_name(&self) -> String { match self { Value::Primitive(p) => p.type_name(), Value::Object(_) => format!("object"), @@ -351,7 +351,7 @@ impl Value { } } - crate fn get_data_by_key(&'a self, name: &str) -> Option<&Tagged> { + pub(crate) fn get_data_by_key(&'a self, name: &str) -> Option<&Tagged> { match self { Value::Object(o) => o.get_data_by_key(name), Value::List(l) => { @@ -374,7 +374,7 @@ impl Value { } #[allow(unused)] - crate fn get_data_by_index(&'a self, idx: usize) -> Option<&Tagged> { + pub(crate) fn get_data_by_index(&'a self, idx: usize) -> Option<&Tagged> { match self { Value::List(l) => l.iter().nth(idx), _ => None, @@ -491,7 +491,7 @@ impl Value { } } - crate fn format_leaf(&self, desc: Option<&String>) -> String { + pub(crate) fn format_leaf(&self, desc: Option<&String>) -> String { match self { Value::Primitive(p) => p.format(desc), Value::Block(b) => itertools::join( @@ -510,7 +510,7 @@ impl Value { } } - crate fn style_leaf(&self) -> &'static str { + pub(crate) fn style_leaf(&self) -> &'static str { match self { Value::Primitive(p) => p.style(), _ => "", @@ -518,7 +518,7 @@ impl Value { } #[allow(unused)] - crate fn compare(&self, operator: &Operator, other: &Value) -> Result { + pub(crate) fn compare(&self, operator: &Operator, other: &Value) -> Result { match operator { _ => { let coerced = coerce_compare(self, other)?; @@ -545,14 +545,14 @@ impl Value { } #[allow(unused)] - crate fn is_string(&self, expected: &str) -> bool { + pub(crate) fn is_string(&self, expected: &str) -> bool { match self { Value::Primitive(Primitive::String(s)) if s == expected => true, other => false, } } - // crate fn as_pair(&self) -> Result<(Tagged, Tagged), ShellError> { + // pub(crate) fn as_pair(&self) -> Result<(Tagged, Tagged), ShellError> { // match self { // Value::List(list) if list.len() == 2 => Ok((list[0].clone(), list[1].clone())), // other => Err(ShellError::string(format!( @@ -562,7 +562,7 @@ impl Value { // } // } - crate fn as_string(&self) -> Result { + pub(crate) fn as_string(&self) -> Result { match self { Value::Primitive(Primitive::String(s)) => Ok(s.clone()), Value::Primitive(Primitive::Boolean(x)) => Ok(format!("{}", x)), @@ -577,7 +577,7 @@ impl Value { } } - crate fn as_i64(&self) -> Result { + pub(crate) fn as_i64(&self) -> Result { match self { Value::Primitive(Primitive::Int(i)) => Ok(*i), Value::Primitive(Primitive::Bytes(b)) => Ok(*b as i64), @@ -589,7 +589,7 @@ impl Value { } } - crate fn is_true(&self) -> bool { + pub(crate) fn is_true(&self) -> bool { match self { Value::Primitive(Primitive::Boolean(true)) => true, _ => false, @@ -640,7 +640,7 @@ impl Value { } impl Tagged { - crate fn as_path(&self) -> Result { + pub(crate) fn as_path(&self) -> Result { match self.item() { Value::Primitive(Primitive::Path(path)) => Ok(path.clone()), other => Err(ShellError::type_error( @@ -651,7 +651,7 @@ impl Tagged { } } -crate fn select_fields(obj: &Value, fields: &[String], tag: impl Into) -> Tagged { +pub(crate) fn select_fields(obj: &Value, fields: &[String], tag: impl Into) -> Tagged { let mut out = TaggedDictBuilder::new(tag); let descs = obj.data_descriptors(); @@ -666,7 +666,7 @@ crate fn select_fields(obj: &Value, fields: &[String], tag: impl Into) -> T out.into_tagged_value() } -crate fn reject_fields(obj: &Value, fields: &[String], tag: impl Into) -> Tagged { +pub(crate) fn reject_fields(obj: &Value, fields: &[String], tag: impl Into) -> Tagged { let mut out = TaggedDictBuilder::new(tag); let descs = obj.data_descriptors(); @@ -683,7 +683,7 @@ crate fn reject_fields(obj: &Value, fields: &[String], tag: impl Into) -> T } #[allow(unused)] -crate fn find(obj: &Value, field: &str, op: &Operator, rhs: &Value) -> bool { +pub(crate) fn find(obj: &Value, field: &str, op: &Operator, rhs: &Value) -> bool { let descs = obj.data_descriptors(); match descs.iter().find(|d| *d == field) { None => false, diff --git a/src/object/config.rs b/src/object/config.rs index 77c974e79..d4793d24d 100644 --- a/src/object/config.rs +++ b/src/object/config.rs @@ -22,14 +22,14 @@ struct Config { extra: IndexMap>, } -crate fn config_path() -> Result { +pub(crate) fn config_path() -> Result { let location = app_root(AppDataType::UserConfig, &APP_INFO) .map_err(|err| ShellError::string(&format!("Couldn't open config file:\n{}", err)))?; Ok(location.join("config.toml")) } -crate fn write_config(config: &IndexMap>) -> Result<(), ShellError> { +pub(crate) fn write_config(config: &IndexMap>) -> Result<(), ShellError> { let location = app_root(AppDataType::UserConfig, &APP_INFO) .map_err(|err| ShellError::string(&format!("Couldn't open config file:\n{}", err)))?; @@ -45,7 +45,7 @@ crate fn write_config(config: &IndexMap>) -> Result<(), Sh Ok(()) } -crate fn config(span: impl Into) -> Result>, ShellError> { +pub(crate) fn config(span: impl Into) -> Result>, ShellError> { let span = span.into(); let location = app_root(AppDataType::UserConfig, &APP_INFO) diff --git a/src/object/dict.rs b/src/object/dict.rs index 1ce9706a1..80e391e26 100644 --- a/src/object/dict.rs +++ b/src/object/dict.rs @@ -79,7 +79,7 @@ impl Dictionary { } } - crate fn get_data_by_key(&self, name: &str) -> Option<&Tagged> { + pub(crate) fn get_data_by_key(&self, name: &str) -> Option<&Tagged> { match self .entries .iter() @@ -90,7 +90,7 @@ impl Dictionary { } } - crate fn debug(&self, f: &mut fmt::Formatter) -> fmt::Result { + pub(crate) fn debug(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut debug = f.debug_struct("Dictionary"); for (desc, value) in self.entries.iter() { diff --git a/src/object/files.rs b/src/object/files.rs index 541e60eb5..ba48aeab9 100644 --- a/src/object/files.rs +++ b/src/object/files.rs @@ -9,7 +9,7 @@ pub enum FileType { Symlink, } -crate fn dir_entry_dict( +pub(crate) fn dir_entry_dict( filename: &std::path::Path, metadata: &std::fs::Metadata, tag: impl Into, diff --git a/src/object/meta.rs b/src/object/meta.rs index b4f026d38..3c2c2f3b8 100644 --- a/src/object/meta.rs +++ b/src/object/meta.rs @@ -87,7 +87,7 @@ impl Tagged { Tagged::from_item(mapped, tag.clone()) } - crate fn copy_span(&self, output: U) -> Tagged { + pub(crate) fn copy_span(&self, output: U) -> Tagged { let span = self.span(); Tagged::from_simple_spanned_item(output, span) @@ -224,8 +224,8 @@ impl Tag { #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize, Hash)] pub struct Span { - crate start: usize, - crate end: usize, + pub(crate) start: usize, + pub(crate) end: usize, } impl From> for Span { diff --git a/src/object/process.rs b/src/object/process.rs index 2d90dba2d..a5b8e9ccd 100644 --- a/src/object/process.rs +++ b/src/object/process.rs @@ -3,7 +3,7 @@ use crate::prelude::*; use itertools::join; use sysinfo::ProcessExt; -crate fn process_dict(proc: &sysinfo::Process, tag: impl Into) -> Tagged { +pub(crate) fn process_dict(proc: &sysinfo::Process, tag: impl Into) -> Tagged { let mut dict = TaggedDictBuilder::new(tag); let cmd = proc.cmd(); diff --git a/src/parser.rs b/src/parser.rs index 249f3d173..2fd891efb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,25 +1,25 @@ -crate mod deserializer; -crate mod hir; -crate mod parse; -crate mod parse_command; -crate mod registry; +pub(crate) mod deserializer; +pub(crate) mod hir; +pub(crate) mod parse; +pub(crate) mod parse_command; +pub(crate) mod registry; use crate::errors::ShellError; -crate use deserializer::ConfigDeserializer; -crate use hir::baseline_parse_tokens::baseline_parse_tokens; -crate use parse::call_node::CallNode; -crate use parse::files::Files; -crate use parse::flag::Flag; -crate use parse::operator::Operator; -crate use parse::parser::{nom_input, pipeline}; -crate use parse::pipeline::{Pipeline, PipelineElement}; -crate use parse::text::Text; -crate use parse::token_tree::{DelimitedNode, Delimiter, PathNode, TokenNode}; -crate use parse::tokens::{RawToken, Token}; -crate use parse::unit::Unit; -crate use parse_command::parse_command; -crate use registry::CommandRegistry; +pub(crate) use deserializer::ConfigDeserializer; +pub(crate) use hir::baseline_parse_tokens::baseline_parse_tokens; +pub(crate) use parse::call_node::CallNode; +pub(crate) use parse::files::Files; +pub(crate) use parse::flag::Flag; +pub(crate) use parse::operator::Operator; +pub(crate) use parse::parser::{nom_input, pipeline}; +pub(crate) use parse::pipeline::{Pipeline, PipelineElement}; +pub(crate) use parse::text::Text; +pub(crate) use parse::token_tree::{DelimitedNode, Delimiter, PathNode, TokenNode}; +pub(crate) use parse::tokens::{RawToken, Token}; +pub(crate) use parse::unit::Unit; +pub(crate) use parse_command::parse_command; +pub(crate) use registry::CommandRegistry; pub fn parse(input: &str) -> Result { let _ = pretty_env_logger::try_init(); diff --git a/src/parser/hir.rs b/src/parser/hir.rs index 2148a179f..6af67b270 100644 --- a/src/parser/hir.rs +++ b/src/parser/hir.rs @@ -1,9 +1,9 @@ -crate mod baseline_parse; -crate mod baseline_parse_tokens; -crate mod binary; -crate mod external_command; -crate mod named; -crate mod path; +pub(crate) mod baseline_parse; +pub(crate) mod baseline_parse_tokens; +pub(crate) mod binary; +pub(crate) mod external_command; +pub(crate) mod named; +pub(crate) mod path; use crate::parser::{registry, Unit}; use crate::prelude::*; @@ -15,15 +15,15 @@ use std::path::PathBuf; use crate::evaluate::Scope; -crate use self::baseline_parse::{ +pub(crate) use self::baseline_parse::{ baseline_parse_single_token, baseline_parse_token_as_number, baseline_parse_token_as_path, baseline_parse_token_as_string, }; -crate use self::baseline_parse_tokens::{baseline_parse_next_expr, TokensIterator}; -crate use self::binary::Binary; -crate use self::external_command::ExternalCommand; -crate use self::named::NamedArguments; -crate use self::path::Path; +pub(crate) use self::baseline_parse_tokens::{baseline_parse_next_expr, TokensIterator}; +pub(crate) use self::binary::Binary; +pub(crate) use self::external_command::ExternalCommand; +pub(crate) use self::named::NamedArguments; +pub(crate) use self::path::Path; pub use self::baseline_parse_tokens::SyntaxType; @@ -129,51 +129,51 @@ impl RawExpression { pub type Expression = Tagged; impl Expression { - crate fn int(i: impl Into, span: impl Into) -> Expression { + pub(crate) fn int(i: impl Into, span: impl Into) -> Expression { Tagged::from_simple_spanned_item(RawExpression::Literal(Literal::Integer(i.into())), span) } - crate fn size(i: impl Into, unit: impl Into, span: impl Into) -> Expression { + pub(crate) fn size(i: impl Into, unit: impl Into, span: impl Into) -> Expression { Tagged::from_simple_spanned_item( RawExpression::Literal(Literal::Size(i.into(), unit.into())), span, ) } - crate fn synthetic_string(s: impl Into) -> Expression { + pub(crate) fn synthetic_string(s: impl Into) -> Expression { RawExpression::Synthetic(Synthetic::String(s.into())).tagged_unknown() } - crate fn string(inner: impl Into, outer: impl Into) -> Expression { + pub(crate) fn string(inner: impl Into, outer: impl Into) -> Expression { Tagged::from_simple_spanned_item( RawExpression::Literal(Literal::String(inner.into())), outer.into(), ) } - crate fn file_path(path: impl Into, outer: impl Into) -> Expression { + pub(crate) fn file_path(path: impl Into, outer: impl Into) -> Expression { Tagged::from_simple_spanned_item(RawExpression::FilePath(path.into()), outer.into()) } - crate fn bare(span: impl Into) -> Expression { + pub(crate) fn bare(span: impl Into) -> Expression { Tagged::from_simple_spanned_item(RawExpression::Literal(Literal::Bare), span.into()) } - crate fn variable(inner: impl Into, outer: impl Into) -> Expression { + pub(crate) fn variable(inner: impl Into, outer: impl Into) -> Expression { Tagged::from_simple_spanned_item( RawExpression::Variable(Variable::Other(inner.into())), outer.into(), ) } - crate fn external_command(inner: impl Into, outer: impl Into) -> Expression { + pub(crate) fn external_command(inner: impl Into, outer: impl Into) -> Expression { Tagged::from_simple_spanned_item( RawExpression::ExternalCommand(ExternalCommand::new(inner.into())), outer.into(), ) } - crate fn it_variable(inner: impl Into, outer: impl Into) -> Expression { + pub(crate) fn it_variable(inner: impl Into, outer: impl Into) -> Expression { Tagged::from_simple_spanned_item( RawExpression::Variable(Variable::It(inner.into())), outer.into(), diff --git a/src/parser/hir/named.rs b/src/parser/hir/named.rs index f95896cbf..96d5132fb 100644 --- a/src/parser/hir/named.rs +++ b/src/parser/hir/named.rs @@ -19,7 +19,7 @@ pub enum NamedValue { #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, new)] pub struct NamedArguments { #[new(default)] - crate named: IndexMap, + pub(crate) named: IndexMap, } impl ToDebug for NamedArguments { diff --git a/src/parser/parse.rs b/src/parser/parse.rs index f80a12d35..9934270ce 100644 --- a/src/parser/parse.rs +++ b/src/parser/parse.rs @@ -1,12 +1,12 @@ -crate mod call_node; -crate mod files; -crate mod flag; -crate mod operator; -crate mod parser; -crate mod pipeline; -crate mod text; -crate mod token_tree; -crate mod token_tree_builder; -crate mod tokens; -crate mod unit; -crate mod util; +pub(crate) mod call_node; +pub(crate) mod files; +pub(crate) mod flag; +pub(crate) mod operator; +pub(crate) mod parser; +pub(crate) mod pipeline; +pub(crate) mod text; +pub(crate) mod token_tree; +pub(crate) mod token_tree_builder; +pub(crate) mod tokens; +pub(crate) mod unit; +pub(crate) mod util; diff --git a/src/parser/parse/pipeline.rs b/src/parser/parse/pipeline.rs index 27a13b77f..2d16b1d7a 100644 --- a/src/parser/parse/pipeline.rs +++ b/src/parser/parse/pipeline.rs @@ -5,8 +5,8 @@ use getset::Getters; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, new)] pub struct Pipeline { - crate parts: Vec, - crate post_ws: Option, + pub(crate) parts: Vec, + pub(crate) post_ws: Option, } #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Getters, new)] diff --git a/src/parser/parse/token_tree.rs b/src/parser/parse/token_tree.rs index 620eab659..211d7afa2 100644 --- a/src/parser/parse/token_tree.rs +++ b/src/parser/parse/token_tree.rs @@ -157,7 +157,7 @@ impl TokenNode { } } - crate fn as_flag(&self, value: &str, source: &Text) -> Option> { + pub(crate) fn as_flag(&self, value: &str, source: &Text) -> Option> { match self { TokenNode::Flag( flag @ Tagged { diff --git a/src/parser/parse/unit.rs b/src/parser/parse/unit.rs index 25c18c5d1..54465fc5e 100644 --- a/src/parser/parse/unit.rs +++ b/src/parser/parse/unit.rs @@ -24,7 +24,7 @@ impl Unit { } } - crate fn compute(&self, size: i64) -> Value { + pub(crate) fn compute(&self, size: i64) -> Value { Value::int(match self { Unit::B => size, Unit::KB => size * 1024, diff --git a/src/parser/registry.rs b/src/parser/registry.rs index 3d24e9921..2f8b57d92 100644 --- a/src/parser/registry.rs +++ b/src/parser/registry.rs @@ -1,5 +1,5 @@ // TODO: Temporary redirect -crate use crate::context::CommandRegistry; +pub(crate) use crate::context::CommandRegistry; use crate::evaluate::{evaluate_baseline_expr, Scope}; use crate::parser::{hir, hir::SyntaxType, parse_command, CallNode}; use crate::prelude::*; @@ -46,7 +46,7 @@ impl PositionalType { } #[allow(unused)] - crate fn to_coerce_hint(&self) -> Option { + pub(crate) fn to_coerce_hint(&self) -> Option { match self { PositionalType::Mandatory(_, SyntaxType::Block) | PositionalType::Optional(_, SyntaxType::Block) => Some(SyntaxType::Block), @@ -54,14 +54,14 @@ impl PositionalType { } } - crate fn name(&self) -> &str { + pub(crate) fn name(&self) -> &str { match self { PositionalType::Mandatory(s, _) => s, PositionalType::Optional(s, _) => s, } } - crate fn syntax_type(&self) -> SyntaxType { + pub(crate) fn syntax_type(&self) -> SyntaxType { match *self { PositionalType::Mandatory(_, t) => t, PositionalType::Optional(_, t) => t, @@ -276,7 +276,7 @@ impl Iterator for PositionalIter<'a> { } impl Signature { - crate fn parse_args( + pub(crate) fn parse_args( &self, call: &Tagged, context: &Context, @@ -290,12 +290,12 @@ impl Signature { } #[allow(unused)] - crate fn signature(&self) -> String { + pub(crate) fn signature(&self) -> String { format!("TODO") } } -crate fn evaluate_args( +pub(crate) fn evaluate_args( call: &hir::Call, registry: &CommandRegistry, scope: &Scope, diff --git a/src/prelude.rs b/src/prelude.rs index 38b61be38..490843550 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -47,37 +47,37 @@ macro_rules! trace_out_stream { }}; } -crate use crate::cli::MaybeOwned; -crate use crate::commands::command::{ +pub(crate) use crate::cli::MaybeOwned; +pub(crate) use crate::commands::command::{ CallInfo, CommandAction, CommandArgs, ReturnSuccess, ReturnValue, RunnableContext, }; -crate use crate::commands::PerItemCommand; -crate use crate::context::CommandRegistry; -crate use crate::context::{Context, SpanSource}; -crate use crate::env::host::handle_unexpected; -crate use crate::env::Host; -crate use crate::errors::ShellError; -crate use crate::object::base as value; -crate use crate::object::meta::{Tag, Tagged, TaggedItem}; -crate use crate::object::types::ExtractType; -crate use crate::object::{Primitive, Value}; -crate use crate::parser::hir::SyntaxType; -crate use crate::parser::registry::Signature; -crate use crate::shell::filesystem_shell::FilesystemShell; -crate use crate::shell::shell_manager::ShellManager; -crate use crate::shell::value_shell::ValueShell; -crate use crate::stream::{InputStream, OutputStream}; -crate use crate::traits::{HasSpan, ToDebug}; -crate use crate::Span; -crate use crate::Text; -crate use futures::stream::BoxStream; -crate use futures::{FutureExt, Stream, StreamExt}; -crate use futures_async_stream::async_stream_block; +pub(crate) use crate::commands::PerItemCommand; +pub(crate) use crate::context::CommandRegistry; +pub(crate) use crate::context::{Context, SpanSource}; +pub(crate) use crate::env::host::handle_unexpected; +pub(crate) use crate::env::Host; +pub(crate) use crate::errors::ShellError; +pub(crate) use crate::object::base as value; +pub(crate) use crate::object::meta::{Tag, Tagged, TaggedItem}; +pub(crate) use crate::object::types::ExtractType; +pub(crate) use crate::object::{Primitive, Value}; +pub(crate) use crate::parser::hir::SyntaxType; +pub(crate) use crate::parser::registry::Signature; +pub(crate) use crate::shell::filesystem_shell::FilesystemShell; +pub(crate) use crate::shell::shell_manager::ShellManager; +pub(crate) use crate::shell::value_shell::ValueShell; +pub(crate) use crate::stream::{InputStream, OutputStream}; +pub(crate) use crate::traits::{HasSpan, ToDebug}; +pub(crate) use crate::Span; +pub(crate) use crate::Text; +pub(crate) use futures::stream::BoxStream; +pub(crate) use futures::{FutureExt, Stream, StreamExt}; +pub(crate) use futures_async_stream::async_stream_block; #[allow(unused)] -crate use serde::{Deserialize, Serialize}; -crate use std::collections::VecDeque; -crate use std::future::Future; -crate use std::sync::{Arc, Mutex}; +pub(crate) use serde::{Deserialize, Serialize}; +pub(crate) use std::collections::VecDeque; +pub(crate) use std::future::Future; +pub(crate) use std::sync::{Arc, Mutex}; pub trait FromInputStream { fn from_input_stream(self) -> OutputStream; diff --git a/src/shell.rs b/src/shell.rs index 11f1abd6c..77670c5ec 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -1,8 +1,8 @@ -crate mod completer; -crate mod filesystem_shell; -crate mod helper; -crate mod shell; -crate mod shell_manager; -crate mod value_shell; +pub(crate) mod completer; +pub(crate) mod filesystem_shell; +pub(crate) mod helper; +pub(crate) mod shell; +pub(crate) mod shell_manager; +pub(crate) mod value_shell; -crate use helper::Helper; +pub(crate) use helper::Helper; diff --git a/src/shell/completer.rs b/src/shell/completer.rs index dea696fea..80ed6cfbb 100644 --- a/src/shell/completer.rs +++ b/src/shell/completer.rs @@ -3,7 +3,7 @@ use derive_new::new; use rustyline::completion::{Completer, FilenameCompleter}; #[derive(new)] -crate struct NuCompleter { +pub(crate) struct NuCompleter { pub file_completer: FilenameCompleter, pub commands: CommandRegistry, } diff --git a/src/shell/filesystem_shell.rs b/src/shell/filesystem_shell.rs index 1f2f94551..2e1623cfd 100644 --- a/src/shell/filesystem_shell.rs +++ b/src/shell/filesystem_shell.rs @@ -14,7 +14,7 @@ use rustyline::hint::{Hinter, HistoryHinter}; use std::path::{Path, PathBuf}; pub struct FilesystemShell { - crate path: String, + pub(crate) path: String, completer: NuCompleter, hinter: HistoryHinter, } diff --git a/src/shell/helper.rs b/src/shell/helper.rs index 6c161289b..039a4b2bc 100644 --- a/src/shell/helper.rs +++ b/src/shell/helper.rs @@ -11,12 +11,12 @@ use rustyline::highlight::Highlighter; use rustyline::hint::Hinter; use std::borrow::Cow::{self, Owned}; -crate struct Helper { +pub(crate) struct Helper { helper: ShellManager, } impl Helper { - crate fn new(helper: ShellManager) -> Helper { + pub(crate) fn new(helper: ShellManager) -> Helper { Helper { helper } } } diff --git a/src/shell/shell_manager.rs b/src/shell/shell_manager.rs index 1d58738fe..136d9b017 100644 --- a/src/shell/shell_manager.rs +++ b/src/shell/shell_manager.rs @@ -14,8 +14,8 @@ use std::sync::{Arc, Mutex}; #[derive(Clone, Debug)] pub struct ShellManager { - crate current_shell: usize, - crate shells: Arc>>>, + pub(crate) current_shell: usize, + pub(crate) shells: Arc>>>, } impl ShellManager { diff --git a/src/shell/value_shell.rs b/src/shell/value_shell.rs index 5e1e8c223..4c9cab5a9 100644 --- a/src/shell/value_shell.rs +++ b/src/shell/value_shell.rs @@ -11,8 +11,8 @@ use std::path::PathBuf; #[derive(Clone, Debug)] pub struct ValueShell { - crate path: String, - crate value: Tagged, + pub(crate) path: String, + pub(crate) value: Tagged, } impl ValueShell { diff --git a/src/stream.rs b/src/stream.rs index 5b73172bf..066acb74a 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -1,7 +1,7 @@ use crate::prelude::*; pub struct InputStream { - crate values: BoxStream<'static, Tagged>, + pub(crate) values: BoxStream<'static, Tagged>, } impl InputStream { @@ -49,7 +49,7 @@ impl From>> for InputStream { } pub struct OutputStream { - crate values: BoxStream<'static, ReturnValue>, + pub(crate) values: BoxStream<'static, ReturnValue>, } impl OutputStream {