Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/codegen/diagnostics_docs.rs')
-rw-r--r--xtask/src/codegen/diagnostics_docs.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/xtask/src/codegen/diagnostics_docs.rs b/xtask/src/codegen/diagnostics_docs.rs
index cf30531e7f..4cb8f3f259 100644
--- a/xtask/src/codegen/diagnostics_docs.rs
+++ b/xtask/src/codegen/diagnostics_docs.rs
@@ -3,8 +3,9 @@
use std::{fmt, fs, io, path::PathBuf};
use crate::{
- codegen::{add_preamble, list_rust_files, CommentBlock, Location},
+ codegen::{add_preamble, CommentBlock, Location},
project_root,
+ util::list_rust_files,
};
pub(crate) fn generate(check: bool) {
@@ -12,7 +13,7 @@ pub(crate) fn generate(check: bool) {
if !check {
let contents =
diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
- let contents = add_preamble("sourcegen_diagnostic_docs", contents);
+ let contents = add_preamble(crate::flags::CodegenType::DiagnosticsDocs, contents);
let dst = project_root().join("docs/user/generated_diagnostic.adoc");
fs::write(dst, contents).unwrap();
}
@@ -63,7 +64,7 @@ fn is_valid_diagnostic_name(diagnostic: &str) -> Result<(), String> {
if diagnostic.chars().any(|c| c.is_ascii_uppercase()) {
return Err("Diagnostic names can't contain uppercase symbols".into());
}
- if diagnostic.chars().any(|c| !c.is_ascii()) {
+ if !diagnostic.is_ascii() {
return Err("Diagnostic can't contain non-ASCII symbols".into());
}