Skip to content

Commit 856cfba

Browse files
committed
quality: fmt
1 parent 64acc4b commit 856cfba

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

crates/spfs/src/graph/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ mod tree;
2020
use std::cell::RefCell;
2121

2222
pub use annotation::{
23-
Annotation, AnnotationValue, DEFAULT_SPFS_ANNOTATION_LAYER_MAX_STRING_VALUE_SIZE,
23+
Annotation,
24+
AnnotationValue,
25+
DEFAULT_SPFS_ANNOTATION_LAYER_MAX_STRING_VALUE_SIZE,
2426
};
2527
pub use blob::Blob;
2628
pub use database::{
27-
Database, DatabaseIterator, DatabaseView, DatabaseWalker, DigestSearchCriteria,
29+
Database,
30+
DatabaseIterator,
31+
DatabaseView,
32+
DatabaseWalker,
33+
DigestSearchCriteria,
2834
};
2935
pub use entry::Entry;
3036
pub use kind::{HasKind, Kind, ObjectKind};

crates/spfs/src/runtime/mod.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ pub mod winfsp;
2121
#[cfg(unix)]
2222
pub use overlayfs::is_removed_entry;
2323
pub use storage::{
24-
makedirs_with_perms, Author, BindMount, Config, Data, KeyValuePair, KeyValuePairBuf, LiveLayer,
25-
LiveLayerFile, MountBackend, OwnedRuntime, Runtime, Status, Storage, STARTUP_FILES_LOCATION,
24+
makedirs_with_perms,
25+
Author,
26+
BindMount,
27+
Config,
28+
Data,
29+
KeyValuePair,
30+
KeyValuePairBuf,
31+
LiveLayer,
32+
LiveLayerFile,
33+
MountBackend,
34+
OwnedRuntime,
35+
Runtime,
36+
Status,
37+
Storage,
38+
STARTUP_FILES_LOCATION,
2639
};
2740
#[cfg(windows)]
2841
pub use winfsp::is_removed_entry;

crates/spfs/src/runtime/storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use tokio::io::AsyncReadExt;
2626

2727
#[cfg(windows)]
2828
use super::startup_ps;
29+
use super::{config_nu, env_nu};
2930
#[cfg(unix)]
3031
use super::{startup_csh, startup_sh};
31-
use super::{config_nu, env_nu};
3232
use crate::encoding::Digest;
3333
use crate::env::SPFS_DIR_PREFIX;
3434
use crate::graph::object::Enum;

crates/spk-cli/group1/src/cmd_completion.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
//! Generate shell completions for "spk"
66
7+
use std::fmt;
78
use std::io::Write;
89

9-
use clap::{value_parser, Command, Parser};
10+
use clap::{value_parser, Command, Parser, ValueEnum};
1011
use clap_complete;
1112
use clap_complete::{Generator, Shell};
1213
use clap_complete_nushell::Nushell;
13-
use clap::ValueEnum;
1414
use miette::Result;
1515
use spk_cli_common::CommandArgs;
1616

@@ -25,17 +25,17 @@ enum ShellCompletion {
2525
/// Nushell
2626
Nushell,
2727
}
28-
impl ToString for ShellCompletion {
29-
fn to_string(&self) -> String {
30-
match self {
31-
ShellCompletion::Bash => "bash".to_string(),
32-
ShellCompletion::Fish => "fish".to_string(),
33-
ShellCompletion::Zsh => "zsh".to_string(),
34-
ShellCompletion::Nushell => "nu".to_string(),
35-
}
28+
impl fmt::Display for ShellCompletion {
29+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30+
let s = match self {
31+
ShellCompletion::Bash => "bash",
32+
ShellCompletion::Fish => "fish",
33+
ShellCompletion::Zsh => "zsh",
34+
ShellCompletion::Nushell => "nu",
35+
};
36+
write!(f, "{}", s)
3637
}
3738
}
38-
3939
impl Generator for ShellCompletion {
4040
/// Generate the file name for the completion script.
4141
fn file_name(&self, name: &str) -> String {

0 commit comments

Comments
 (0)