Rename some files (#952)

* renamed some files

* clippy

* update tests
This commit is contained in:
Darren Schroeder 2022-02-05 11:35:02 -06:00 committed by GitHub
parent 3eba90232a
commit 2dd32c2b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 63 additions and 62 deletions

View File

@ -1,4 +1,4 @@
mod command;
mod date_;
mod format;
mod humanize;
mod list_timezone;
@ -8,7 +8,7 @@ mod to_table;
mod to_timezone;
mod utils;
pub use command::Date;
pub use date_::Date;
pub use format::SubCommand as DateFormat;
pub use humanize::SubCommand as DateHumanize;
pub use list_timezone::SubCommand as DateListTimezones;

View File

@ -188,12 +188,12 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
AnsiGradient,
AnsiStrip,
Clear,
DefaultKeybindings,
KeybindingsDefault,
Input,
InputKeys,
KeybindingsListen,
Keybindings,
Kill,
ListKeybindings,
KeybindingsList,
Sleep,
TermSize,
};

View File

@ -97,7 +97,7 @@ impl Command for Drop {
#[cfg(test)]
mod test {
use super::*;
use crate::Drop;
#[test]
fn test_examples() {

View File

@ -1,7 +1,7 @@
pub mod column;
pub mod command;
pub mod drop_;
pub mod nth;
pub use column::DropColumn;
pub use command::Drop;
pub use drop_::Drop;
pub use nth::DropNth;

View File

@ -89,7 +89,7 @@ impl Command for Keep {
#[cfg(test)]
mod tests {
use super::*;
use crate::Keep;
#[test]
fn test_examples() {

View File

@ -76,7 +76,7 @@ impl Command for KeepUntil {
#[cfg(test)]
mod tests {
use super::*;
use crate::KeepUntil;
#[test]
fn test_examples() {

View File

@ -76,7 +76,7 @@ impl Command for KeepWhile {
#[cfg(test)]
mod tests {
use super::*;
use crate::KeepWhile;
#[test]
fn test_examples() {

View File

@ -1,7 +1,7 @@
mod command;
mod until;
mod while_;
mod keep_;
mod keep_until;
mod keep_while;
pub use command::Keep;
pub use until::KeepUntil;
pub use while_::KeepWhile;
pub use keep_::Keep;
pub use keep_until::KeepUntil;
pub use keep_while::KeepWhile;

View File

@ -1,7 +1,7 @@
mod command;
mod until;
mod while_;
mod skip_;
mod skip_until;
mod skip_while;
pub use command::Skip;
pub use until::SkipUntil;
pub use while_::SkipWhile;
pub use skip_::Skip;
pub use skip_until::SkipUntil;
pub use skip_while::SkipWhile;

View File

@ -80,7 +80,7 @@ impl Command for Skip {
#[cfg(test)]
mod tests {
use super::*;
use crate::Skip;
#[test]
fn test_examples() {

View File

@ -75,7 +75,7 @@ impl Command for SkipUntil {
#[cfg(test)]
mod tests {
use super::*;
use crate::SkipUntil;
#[test]
fn test_examples() {

View File

@ -75,7 +75,7 @@ impl Command for SkipWhile {
#[cfg(test)]
mod tests {
use super::*;
use crate::SkipWhile;
#[test]
fn test_examples() {

View File

@ -1,10 +1,10 @@
mod base64;
mod command;
mod generic_digest;
mod hash_;
mod md5;
mod sha256;
pub use self::base64::Base64;
pub use self::command::Hash;
pub use self::hash_::Hash;
pub use self::md5::HashMd5;
pub use self::sha256::HashSha256;

View File

@ -1,9 +1,9 @@
mod abs;
mod avg;
mod ceil;
pub mod command;
mod eval;
mod floor;
pub mod math_;
mod max;
mod median;
mod min;
@ -20,9 +20,9 @@ mod variance;
pub use abs::SubCommand as MathAbs;
pub use avg::SubCommand as MathAvg;
pub use ceil::SubCommand as MathCeil;
pub use command::MathCommand as Math;
pub use eval::SubCommand as MathEval;
pub use floor::SubCommand as MathFloor;
pub use math_::MathCommand as Math;
pub use max::SubCommand as MathMax;
pub use median::SubCommand as MathMedian;
pub use min::SubCommand as MathMin;

View File

@ -1,8 +1,8 @@
mod command;
mod host;
mod path;
mod query;
mod scheme;
mod url_;
use nu_engine::CallExt;
use nu_protocol::{
@ -16,7 +16,7 @@ pub use self::host::SubCommand as UrlHost;
pub use self::path::SubCommand as UrlPath;
pub use self::query::SubCommand as UrlQuery;
pub use self::scheme::SubCommand as UrlScheme;
pub use command::Url;
pub use url_::Url;
fn handle_value<F>(action: &F, v: &Value, span: Span) -> Value
where

View File

@ -1,10 +1,10 @@
mod basename;
pub mod command;
mod dirname;
mod exists;
mod expand;
mod join;
mod parse;
pub mod path_;
mod relative_to;
mod split;
mod r#type;
@ -12,12 +12,12 @@ mod r#type;
use std::path::Path as StdPath;
pub use basename::SubCommand as PathBasename;
pub use command::PathCommand as Path;
pub use dirname::SubCommand as PathDirname;
pub use exists::SubCommand as PathExists;
pub use expand::SubCommand as PathExpand;
pub use join::SubCommand as PathJoin;
pub use parse::SubCommand as PathParse;
pub use path_::PathCommand as Path;
pub use r#type::SubCommand as PathType;
pub use relative_to::SubCommand as PathRelativeTo;
pub use split::SubCommand as PathSplit;

View File

@ -445,7 +445,7 @@ fn build_ansi_hashmap(v: &'static [AnsiCode]) -> HashMap<&'static str, &'static
#[cfg(test)]
mod tests {
use super::AnsiCommand;
use crate::platform::ansi::ansi_::AnsiCommand;
#[test]
fn examples_work_as_expected() {

View File

@ -1,7 +1,7 @@
mod command;
mod ansi_;
mod gradient;
mod strip;
pub use command::AnsiCommand as Ansi;
pub use ansi_::AnsiCommand as Ansi;
pub use gradient::SubCommand as AnsiGradient;
pub use strip::SubCommand as AnsiStrip;

View File

@ -14,6 +14,6 @@ pub use dir_info::{DirBuilder, DirInfo, FileInfo};
pub use du::Du;
pub use input::Input;
pub use kill::Kill;
pub use reedline_commands::{DefaultKeybindings, InputKeys, Keybindings, ListKeybindings};
pub use reedline_commands::{Keybindings, KeybindingsDefault, KeybindingsList, KeybindingsListen};
pub use sleep::Sleep;
pub use term_size::TermSize;

View File

@ -6,9 +6,9 @@ use nu_protocol::{
use reedline::get_reedline_default_keybindings;
#[derive(Clone)]
pub struct DefaultKeybindings;
pub struct KeybindingsDefault;
impl Command for DefaultKeybindings {
impl Command for KeybindingsDefault {
fn name(&self) -> &str {
"keybindings default"
}

View File

@ -9,9 +9,9 @@ use reedline::{
};
#[derive(Clone)]
pub struct ListKeybindings;
pub struct KeybindingsList;
impl Command for ListKeybindings {
impl Command for KeybindingsList {
fn name(&self) -> &str {
"keybindings list"
}

View File

@ -8,9 +8,9 @@ use nu_protocol::{
use std::io::{stdout, Write};
#[derive(Clone)]
pub struct InputKeys;
pub struct KeybindingsListen;
impl Command for InputKeys {
impl Command for KeybindingsListen {
fn name(&self) -> &str {
"keybindings listen"
}
@ -141,11 +141,11 @@ fn print_events_helper(event: Event) -> Result<Value, ShellError> {
#[cfg(test)]
mod tests {
use super::InputKeys;
use crate::KeybindingsListen;
#[test]
fn examples_work_as_expected() {
use crate::test_examples;
test_examples(InputKeys {})
test_examples(KeybindingsListen {})
}
}

View File

@ -1,9 +1,9 @@
mod command;
mod default_keybindings;
mod input_keys;
mod list_keybindings;
mod keybindings;
mod keybindings_default;
mod keybindings_list;
mod keybindings_listen;
pub use command::Keybindings;
pub use default_keybindings::DefaultKeybindings;
pub use input_keys::InputKeys;
pub use list_keybindings::ListKeybindings;
pub use keybindings::Keybindings;
pub use keybindings_default::KeybindingsDefault;
pub use keybindings_list::KeybindingsList;
pub use keybindings_listen::KeybindingsListen;

View File

@ -1,9 +1,9 @@
mod bool;
mod chars;
mod command;
mod decimal;
mod dice;
mod integer;
mod random_;
mod uuid;
pub use self::bool::SubCommand as RandomBool;
@ -12,4 +12,4 @@ pub use self::decimal::SubCommand as RandomDecimal;
pub use self::dice::SubCommand as RandomDice;
pub use self::integer::SubCommand as RandomInteger;
pub use self::uuid::SubCommand as RandomUuid;
pub use command::RandomCommand as Random;
pub use random_::RandomCommand as Random;

View File

@ -1,16 +1,16 @@
pub mod camel_case;
pub mod command;
pub mod kebab_case;
pub mod pascal_case;
pub mod screaming_snake_case;
pub mod snake_case;
pub mod str_;
pub use camel_case::SubCommand as StrCamelCase;
pub use command::Str;
pub use kebab_case::SubCommand as StrKebabCase;
pub use pascal_case::SubCommand as StrPascalCase;
pub use screaming_snake_case::SubCommand as StrScreamingSnakeCase;
pub use snake_case::SubCommand as StrSnakeCase;
pub use str_::Str;
use nu_engine::CallExt;

View File

@ -38,7 +38,7 @@ impl Command for Str {
#[cfg(test)]
mod test {
use super::*;
use crate::Str;
#[test]
fn test_examples() {

View File

@ -1,2 +1,2 @@
mod command;
pub use command::SubCommand as Trim;
mod trim_;
pub use trim_::SubCommand as Trim;

View File

@ -321,7 +321,8 @@ fn trim(s: &str, char_: Option<char>, closure_flags: &ClosureFlags) -> String {
#[cfg(test)]
mod tests {
use super::*;
use crate::strings::str_::trim::trim_::*;
use nu_protocol::{Span, Value};
#[test]
fn test_examples() {