Skip to content

Commit 074062a

Browse files
committed
refactor(lint): clarify lint docs path
1 parent 9735387 commit 074062a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/xtask-lint-docs/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ fn main() -> anyhow::Result<()> {
5757

5858
buf.push_str(&lint_docs);
5959

60+
let docs_output_path = lint_docs_output_path();
6061
if check {
61-
let old = std::fs::read_to_string(lint_docs_path())?;
62+
let old = std::fs::read_to_string(docs_output_path)?;
6263
if old != buf {
6364
anyhow::bail!(
6465
"The lints documentation is out-of-date. Run `cargo lint-docs` to update it."
6566
);
6667
}
6768
} else {
68-
std::fs::write(lint_docs_path(), buf)?;
69+
std::fs::write(docs_output_path, buf)?;
6970
}
7071
Ok(())
7172
}
@@ -97,7 +98,7 @@ fn add_level_section(level: LintLevel, lint_names: &[&str], buf: &mut String) ->
9798
Ok(())
9899
}
99100

100-
fn lint_docs_path() -> PathBuf {
101+
fn lint_docs_output_path() -> PathBuf {
101102
let pkg_root = env!("CARGO_MANIFEST_DIR");
102103
let ws_root = PathBuf::from(format!("{pkg_root}/../.."));
103104
let path = {

0 commit comments

Comments
 (0)