Skip to content

Commit 9ff6fab

Browse files
Copilotnunoplopes
andauthored
Revert unrelated Rust source edits from clippy workflow change
Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/0d7756ba-9678-4a15-b2f9-5e6975d34282 Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
1 parent d202201 commit 9ff6fab

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

rule-preprocessor/src/syntactic.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,12 @@ impl<'a> FnIrBuilder<'a> {
435435

436436
let mut ctx = FragmentCtx::new(self, params, generic_names);
437437
for child in stmt_list.syntax().children_with_tokens() {
438-
if let ra_ap_syntax::NodeOrToken::Token(ref t) = child
439-
&& (t.kind() == SyntaxKind::L_CURLY || t.kind() == SyntaxKind::R_CURLY)
440-
&& t.parent().as_ref() == Some(stmt_list.syntax())
441-
{
442-
continue;
438+
if let ra_ap_syntax::NodeOrToken::Token(ref t) = child {
439+
if (t.kind() == SyntaxKind::L_CURLY || t.kind() == SyntaxKind::R_CURLY)
440+
&& t.parent().as_ref() == Some(stmt_list.syntax())
441+
{
442+
continue;
443+
}
443444
}
444445
ctx.visit(child);
445446
}

rules/build.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ fn main() {
1414
// Collect all tgt_*.rs files
1515
let mut files = Vec::new();
1616
visit(&crate_root, &mut |p| {
17-
if let Some(name) = p.file_name().and_then(|s| s.to_str())
18-
&& name.starts_with("tgt_")
19-
&& name.ends_with(".rs")
20-
{
21-
files.push(p.to_path_buf());
17+
if let Some(name) = p.file_name().and_then(|s| s.to_str()) {
18+
if name.starts_with("tgt_") && name.ends_with(".rs") {
19+
files.push(p.to_path_buf());
20+
}
2221
}
2322
});
2423
files.sort();
@@ -42,7 +41,9 @@ fn main() {
4241
.to_string_lossy()
4342
.replace('\\', "/")
4443
.trim_start_matches("./")
45-
.replace(['/', '.', '-'], "_");
44+
.replace('/', "_")
45+
.replace('.', "_")
46+
.replace('-', "_");
4647

4748
if let Some(stripped) = module_name.strip_suffix("_rs") {
4849
module_name = stripped.to_string();

0 commit comments

Comments
 (0)