This commit is contained in:
2026-01-29 17:42:10 +01:00
parent 10540388a6
commit e58a986e9f
2 changed files with 21 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
# 27.01.2026
- [ ] Test 1
- [ ] Test 2
# 28.01.2026
- [x] Test 1
- [ ] Test 2
- [ ] Test 3
- [x] Test 4
- [x] Test 5
# 2026-01-29
- [ ] Test 2
- [ ] Test 3

View File

@@ -94,7 +94,6 @@ fn update_notes(notes_path: &Path) {
linebuf.clear();
}
// Find duplicates
let mut todos_hashset: HashSet<&str> = HashSet::new();
let split_lines = all_lines.rsplit("\n");
for (rev_idx, line) in split_lines.enumerate() {
@@ -107,13 +106,8 @@ fn update_notes(notes_path: &Path) {
let Some(todotext) = trimmed_str.get(6..) else {
continue;
};
if !todos_hashset.insert(todotext) {
// false if dupl
if !todos_hashset.insert(todotext) || is_done(prefix) {
lines_to_not_use.push(org_idx);
} else {
if is_done(prefix) {
lines_to_not_use.push(org_idx);
}
}
}
@@ -136,15 +130,14 @@ fn update_notes(notes_path: &Path) {
let mut cur = lines_to_not_use.len() - 1;
for (idx, line) in all_lines.split("\n").enumerate() {
if cur > 0 && lines_to_not_use.get(cur).unwrap() == &idx {
cur -= 1;
if lines_to_not_use.get(cur).unwrap() == &idx {
cur = cur.saturating_sub(1);
} else {
writeln!(linebuf, "{line}").unwrap_or_else(|e| panic!("{e}"));
}
}
file.write_all(linebuf.as_bytes()).unwrap_or_else(|e| panic!("Maaan look out for these files. Error is: {e}"));
// dbg!(&linebuf);
}
// fn parse_patterns(notes_path: &Path, patterns_path: &Path) {