Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/flags.rs')
-rw-r--r--xtask/src/flags.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs
index 00fa3117b3..4bc844ab7e 100644
--- a/xtask/src/flags.rs
+++ b/xtask/src/flags.rs
@@ -1,6 +1,6 @@
#![allow(unreachable_pub)]
-use std::str::FromStr;
+use std::{fmt, str::FromStr};
use crate::install::{ClientOpt, ServerOpt};
@@ -187,6 +187,18 @@ pub enum CodegenType {
LintDefinitions,
}
+impl fmt::Display for CodegenType {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::All => write!(f, "all"),
+ Self::Grammar => write!(f, "grammar"),
+ Self::AssistsDocTests => write!(f, "assists-doc-tests"),
+ Self::DiagnosticsDocs => write!(f, "diagnostics-docs"),
+ Self::LintDefinitions => write!(f, "lint-definitions"),
+ }
+ }
+}
+
impl FromStr for CodegenType {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {