Skip to content

Commit

Permalink
Minor langtool update
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 26, 2023
1 parent d6324d1 commit b76d519
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Tools/langtool/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Tools/langtool/src/inifile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@ impl IniFile {
}

pub fn get_section_mut(&mut self, section_name: &str) -> Option<&mut Section> {
for section in &mut self.sections {
if section.name == section_name {
return Some(section);
}
}
None
self.sections
.iter_mut()
.find(|section| section.name == section_name)
}
}

Expand Down
10 changes: 4 additions & 6 deletions Tools/langtool/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ impl Section {
if prefix.starts_with("Font") || prefix.starts_with('#') {
continue;
}
if !other.lines.iter().any(|line| line.starts_with(prefix)) {
if !prefix.contains("URL") {
println!("Commenting out from {}: {line}", other.name);
// Comment out the line.
*line = "#".to_owned() + line;
}
if !other.lines.iter().any(|line| line.starts_with(prefix)) && !prefix.contains("URL") {
println!("Commenting out from {}: {line}", other.name);
// Comment out the line.
*line = "#".to_owned() + line;
}
}
}
Expand Down

0 comments on commit b76d519

Please sign in to comment.