From d9dcfd81c5d4325379ac88c4250b9c77ecbd75e8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 1 Mar 2021 20:16:23 +0300 Subject: Simplify xtask lib/bin/test separation isn't really needed. --- xtask/src/codegen/gen_assists_docs.rs | 4 ++-- xtask/src/codegen/gen_diagnostic_docs.rs | 2 +- xtask/src/codegen/gen_feature_docs.rs | 2 +- xtask/src/codegen/gen_lint_completions.rs | 2 +- xtask/src/codegen/gen_parser_tests.rs | 2 +- xtask/src/codegen/gen_syntax.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'xtask/src/codegen') diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 1ae1343a5..c469b388d 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs @@ -7,12 +7,12 @@ use crate::{ project_root, rust_files_in, Result, }; -pub fn generate_assists_tests(mode: Mode) -> Result<()> { +pub(crate) fn generate_assists_tests(mode: Mode) -> Result<()> { let assists = Assist::collect()?; generate_tests(&assists, mode) } -pub fn generate_assists_docs(mode: Mode) -> Result<()> { +pub(crate) fn generate_assists_docs(mode: Mode) -> Result<()> { let assists = Assist::collect()?; let contents = assists.into_iter().map(|it| it.to_string()).collect::>().join("\n\n"); let contents = format!("//{}\n{}\n", PREAMBLE, contents.trim()); diff --git a/xtask/src/codegen/gen_diagnostic_docs.rs b/xtask/src/codegen/gen_diagnostic_docs.rs index 7c14d4a07..a2561817b 100644 --- a/xtask/src/codegen/gen_diagnostic_docs.rs +++ b/xtask/src/codegen/gen_diagnostic_docs.rs @@ -7,7 +7,7 @@ use crate::{ project_root, rust_files, Result, }; -pub fn generate_diagnostic_docs(mode: Mode) -> Result<()> { +pub(crate) fn generate_diagnostic_docs(mode: Mode) -> Result<()> { let diagnostics = Diagnostic::collect()?; let contents = diagnostics.into_iter().map(|it| it.to_string()).collect::>().join("\n\n"); diff --git a/xtask/src/codegen/gen_feature_docs.rs b/xtask/src/codegen/gen_feature_docs.rs index 61081063b..cad7ff477 100644 --- a/xtask/src/codegen/gen_feature_docs.rs +++ b/xtask/src/codegen/gen_feature_docs.rs @@ -7,7 +7,7 @@ use crate::{ project_root, rust_files, Result, }; -pub fn generate_feature_docs(mode: Mode) -> Result<()> { +pub(crate) fn generate_feature_docs(mode: Mode) -> Result<()> { let features = Feature::collect()?; let contents = features.into_iter().map(|it| it.to_string()).collect::>().join("\n\n"); let contents = format!("//{}\n{}\n", PREAMBLE, contents.trim()); diff --git a/xtask/src/codegen/gen_lint_completions.rs b/xtask/src/codegen/gen_lint_completions.rs index 8c51d35c7..b1c057037 100644 --- a/xtask/src/codegen/gen_lint_completions.rs +++ b/xtask/src/codegen/gen_lint_completions.rs @@ -10,7 +10,7 @@ use crate::{ run_rustfmt, }; -pub fn generate_lint_completions(mode: Mode) -> Result<()> { +pub(crate) fn generate_lint_completions(mode: Mode) -> Result<()> { if !Path::new("./target/rust").exists() { cmd!("git clone --depth=1 https://github.com/rust-lang/rust ./target/rust").run()?; } diff --git a/xtask/src/codegen/gen_parser_tests.rs b/xtask/src/codegen/gen_parser_tests.rs index 6e4abd10c..cb8939063 100644 --- a/xtask/src/codegen/gen_parser_tests.rs +++ b/xtask/src/codegen/gen_parser_tests.rs @@ -12,7 +12,7 @@ use crate::{ project_root, Result, }; -pub fn generate_parser_tests(mode: Mode) -> Result<()> { +pub(crate) fn generate_parser_tests(mode: Mode) -> Result<()> { let tests = tests_from_dir(&project_root().join(Path::new("crates/parser/src/grammar")))?; fn install_tests(tests: &HashMap, into: &str, mode: Mode) -> Result<()> { let tests_dir = project_root().join(into); diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index eb524d85a..191bc0e9d 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs @@ -18,7 +18,7 @@ use crate::{ project_root, Result, }; -pub fn generate_syntax(mode: Mode) -> Result<()> { +pub(crate) fn generate_syntax(mode: Mode) -> Result<()> { let grammar = rust_grammar(); let ast = lower(&grammar); -- cgit v1.2.3