aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen.rs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-14 22:20:27 +0000
committerSeivan Heidari <[email protected]>2019-11-14 22:20:27 +0000
commitc622413bc72ea56d5f62a16788d897cb61eca948 (patch)
tree9de3dbe8b5c935ed168efac4e70770e54fbe0714 /xtask/src/codegen.rs
parent0525778a3ad590492b51cc11085d815f9bb8f92b (diff)
parentbbb022d3999b3038549ec6c309efb065231c896a (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'xtask/src/codegen.rs')
-rw-r--r--xtask/src/codegen.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs
index 770b55a9a..53f524f42 100644
--- a/xtask/src/codegen.rs
+++ b/xtask/src/codegen.rs
@@ -52,7 +52,7 @@ fn update(path: &Path, contents: &str, mode: Mode) -> Result<()> {
52 _ => (), 52 _ => (),
53 } 53 }
54 if mode == Mode::Verify { 54 if mode == Mode::Verify {
55 Err(format!("`{}` is not up-to-date", path.display()))?; 55 anyhow::bail!("`{}` is not up-to-date", path.display());
56 } 56 }
57 eprintln!("updating {}", path.display()); 57 eprintln!("updating {}", path.display());
58 fs::write(path, contents)?; 58 fs::write(path, contents)?;
@@ -101,10 +101,8 @@ fn do_extract_comment_blocks(text: &str, allow_blocks_with_empty_lins: bool) ->
101 let is_comment = line.starts_with(prefix); 101 let is_comment = line.starts_with(prefix);
102 if is_comment { 102 if is_comment {
103 block.push(line[prefix.len()..].to_string()); 103 block.push(line[prefix.len()..].to_string());
104 } else { 104 } else if !block.is_empty() {
105 if !block.is_empty() { 105 res.push(mem::replace(&mut block, Vec::new()));
106 res.push(mem::replace(&mut block, Vec::new()))
107 }
108 } 106 }
109 } 107 }
110 if !block.is_empty() { 108 if !block.is_empty() {