diff options
Diffstat (limited to 'xtask/src/codegen/gen_assists_docs.rs')
-rw-r--r-- | xtask/src/codegen/gen_assists_docs.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index f0ded8b87..d7c85ebe9 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Generates `assists.md` documentation. | 1 | //! Generates `assists.md` documentation. |
2 | 2 | ||
3 | use std::{fmt, fs, path::Path}; | 3 | use std::{fmt, path::Path}; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | codegen::{self, extract_comment_blocks_with_empty_lines, reformat, Location, Mode, PREAMBLE}, | 6 | codegen::{self, extract_comment_blocks_with_empty_lines, reformat, Location, Mode, PREAMBLE}, |
@@ -39,7 +39,7 @@ impl Assist { | |||
39 | return Ok(res); | 39 | return Ok(res); |
40 | 40 | ||
41 | fn collect_file(acc: &mut Vec<Assist>, path: &Path) -> Result<()> { | 41 | fn collect_file(acc: &mut Vec<Assist>, path: &Path) -> Result<()> { |
42 | let text = fs::read_to_string(path)?; | 42 | let text = xshell::read_file(path)?; |
43 | let comment_blocks = extract_comment_blocks_with_empty_lines("Assist", &text); | 43 | let comment_blocks = extract_comment_blocks_with_empty_lines("Assist", &text); |
44 | 44 | ||
45 | for block in comment_blocks { | 45 | for block in comment_blocks { |
@@ -134,7 +134,7 @@ r#####" | |||
134 | 134 | ||
135 | buf.push_str(&test) | 135 | buf.push_str(&test) |
136 | } | 136 | } |
137 | let buf = reformat(buf)?; | 137 | let buf = reformat(&buf.to_string())?; |
138 | codegen::update(&project_root().join("crates/assists/src/tests/generated.rs"), &buf, mode) | 138 | codegen::update(&project_root().join("crates/assists/src/tests/generated.rs"), &buf, mode) |
139 | } | 139 | } |
140 | 140 | ||