Skip to content

Commit

Permalink
quality: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleailes committed Sep 9, 2024
1 parent 64acc4b commit 856cfba
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
10 changes: 8 additions & 2 deletions crates/spfs/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ mod tree;
use std::cell::RefCell;

pub use annotation::{
Annotation, AnnotationValue, DEFAULT_SPFS_ANNOTATION_LAYER_MAX_STRING_VALUE_SIZE,
Annotation,
AnnotationValue,
DEFAULT_SPFS_ANNOTATION_LAYER_MAX_STRING_VALUE_SIZE,
};
pub use blob::Blob;
pub use database::{
Database, DatabaseIterator, DatabaseView, DatabaseWalker, DigestSearchCriteria,
Database,
DatabaseIterator,
DatabaseView,
DatabaseWalker,
DigestSearchCriteria,
};
pub use entry::Entry;
pub use kind::{HasKind, Kind, ObjectKind};
Expand Down
17 changes: 15 additions & 2 deletions crates/spfs/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,21 @@ pub mod winfsp;
#[cfg(unix)]
pub use overlayfs::is_removed_entry;
pub use storage::{
makedirs_with_perms, Author, BindMount, Config, Data, KeyValuePair, KeyValuePairBuf, LiveLayer,
LiveLayerFile, MountBackend, OwnedRuntime, Runtime, Status, Storage, STARTUP_FILES_LOCATION,
makedirs_with_perms,
Author,
BindMount,
Config,
Data,
KeyValuePair,
KeyValuePairBuf,
LiveLayer,
LiveLayerFile,
MountBackend,
OwnedRuntime,
Runtime,
Status,
Storage,
STARTUP_FILES_LOCATION,
};
#[cfg(windows)]
pub use winfsp::is_removed_entry;
2 changes: 1 addition & 1 deletion crates/spfs/src/runtime/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use tokio::io::AsyncReadExt;

#[cfg(windows)]
use super::startup_ps;
use super::{config_nu, env_nu};
#[cfg(unix)]
use super::{startup_csh, startup_sh};
use super::{config_nu, env_nu};
use crate::encoding::Digest;
use crate::env::SPFS_DIR_PREFIX;
use crate::graph::object::Enum;
Expand Down
22 changes: 11 additions & 11 deletions crates/spk-cli/group1/src/cmd_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

//! Generate shell completions for "spk"

use std::fmt;
use std::io::Write;

use clap::{value_parser, Command, Parser};
use clap::{value_parser, Command, Parser, ValueEnum};
use clap_complete;
use clap_complete::{Generator, Shell};
use clap_complete_nushell::Nushell;
use clap::ValueEnum;
use miette::Result;
use spk_cli_common::CommandArgs;

Expand All @@ -25,17 +25,17 @@ enum ShellCompletion {
/// Nushell
Nushell,
}
impl ToString for ShellCompletion {
fn to_string(&self) -> String {
match self {
ShellCompletion::Bash => "bash".to_string(),
ShellCompletion::Fish => "fish".to_string(),
ShellCompletion::Zsh => "zsh".to_string(),
ShellCompletion::Nushell => "nu".to_string(),
}
impl fmt::Display for ShellCompletion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let s = match self {
ShellCompletion::Bash => "bash",
ShellCompletion::Fish => "fish",
ShellCompletion::Zsh => "zsh",
ShellCompletion::Nushell => "nu",
};
write!(f, "{}", s)
}
}

impl Generator for ShellCompletion {
/// Generate the file name for the completion script.
fn file_name(&self, name: &str) -> String {
Expand Down

0 comments on commit 856cfba

Please sign in to comment.