Skip to content

Commit

Permalink
add BashFormatter::as_cmd method
Browse files Browse the repository at this point in the history
  • Loading branch information
b1ek committed May 30, 2024
1 parent 8432007 commit da619d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ impl BashFormatter {
}
}

pub fn as_cmd<T: From<&'static str>>(self: &Self) -> T {
match self {
BashFormatter::shfmt => "shfmt".into()
}
}

/// Format code using the formatter
pub fn format(self: &Self, code: String) -> String {
match self {
Expand Down

0 comments on commit da619d5

Please sign in to comment.