From da619d5e820d0f923246f084cf75fb0223a06334 Mon Sep 17 00:00:00 2001 From: b1ek Date: Thu, 30 May 2024 21:58:51 +1000 Subject: [PATCH] add BashFormatter::as_cmd method --- src/modules/formatter.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/formatter.rs b/src/modules/formatter.rs index 805135de..f732cb96 100644 --- a/src/modules/formatter.rs +++ b/src/modules/formatter.rs @@ -39,6 +39,12 @@ impl BashFormatter { } } + pub fn as_cmd>(self: &Self) -> T { + match self { + BashFormatter::shfmt => "shfmt".into() + } + } + /// Format code using the formatter pub fn format(self: &Self, code: String) -> String { match self {