fix some typos (#7773)

# Description

Nothing changed, just fix some typos

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
Justin Ma
2023-01-16 19:43:46 +08:00
committed by GitHub
parent 26e6516626
commit f823c7cb5d
11 changed files with 36 additions and 36 deletions

View File

@ -115,11 +115,11 @@ pub fn create_commands(registry: &mut CommandRegistry) {
registry.register_command_reactive(TweakCmd::default());
}
pub fn create_aliases(regestry: &mut CommandRegistry) {
regestry.create_aliase("h", HelpCmd::NAME);
regestry.create_aliase("e", ExpandCmd::NAME);
regestry.create_aliase("q", QuitCmd::NAME);
regestry.create_aliase("q!", QuitCmd::NAME);
pub fn create_aliases(registry: &mut CommandRegistry) {
registry.create_aliases("h", HelpCmd::NAME);
registry.create_aliases("e", ExpandCmd::NAME);
registry.create_aliases("q", QuitCmd::NAME);
registry.create_aliases("q!", QuitCmd::NAME);
}
#[rustfmt::skip]

View File

@ -46,7 +46,7 @@ impl CommandRegistry {
);
}
pub fn create_aliase(&mut self, aliases: &str, command: &str) {
pub fn create_aliases(&mut self, aliases: &str, command: &str) {
self.aliases.insert(
Cow::Owned(aliases.to_owned()),
Cow::Owned(command.to_owned()),

View File

@ -18,7 +18,7 @@ use super::{coloredtextw::ColoredTextW, cursor::XYCursor, Layout, View, ViewConf
// todo: Add wrap option
#[derive(Debug)]
pub struct Preview {
underlaying_value: Option<Value>,
underlying_value: Option<Value>,
lines: Vec<String>,
cursor: XYCursor,
}
@ -34,12 +34,12 @@ impl Preview {
Self {
lines,
cursor,
underlaying_value: None,
underlying_value: None,
}
}
pub fn set_value(&mut self, value: Value) {
self.underlaying_value = Some(value);
self.underlying_value = Some(value);
}
}
@ -147,7 +147,7 @@ impl View for Preview {
}
fn exit(&mut self) -> Option<Value> {
match &self.underlaying_value {
match &self.underlying_value {
Some(value) => Some(value.clone()),
None => {
let text = self.lines.join("\n");