Skip to content

Commit

Permalink
broken calculate_sort_key
Browse files Browse the repository at this point in the history
  • Loading branch information
maksym-arutyunyan committed Jul 21, 2024
1 parent 59a2c96 commit 8b2aa45
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ impl<'a> Item<'a> {

fn add_item(&mut self, line: &'a str) {
self.item.push(line);
self.calculate_sort_key();
}

fn calculate_sort_key(&mut self) {
todo!("fix this");
let joined = self.item.join("\n");

Check failure on line 64 in src/block.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable statement

error: unreachable statement --> src/block.rs:64:9 | 63 | todo!("fix this"); | ----------------- any code following this expression is unreachable 64 | let joined = self.item.join("\n"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | = note: `-D unreachable-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unreachable_code)]`

Check failure on line 64 in src/block.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable statement

error: unreachable statement --> src/block.rs:64:9 | 63 | todo!("fix this"); | ----------------- any code following this expression is unreachable 64 | let joined = self.item.join("\n"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | = note: `-D unreachable-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unreachable_code)]`
let text = joined.as_str();
self.sort_key = match self.strategy {
SortStrategy::Generic => SortKey::Generic(line),
SortStrategy::Bazel => SortKey::Bazel(BazelSortKey::new(line)),
SortStrategy::CargoToml => SortKey::Generic(line),
SortStrategy::Generic => SortKey::Generic(text),
SortStrategy::Bazel => SortKey::Bazel(BazelSortKey::new(text)),
SortStrategy::CargoToml => SortKey::Generic(text),
};
}
}
Expand Down

0 comments on commit 8b2aa45

Please sign in to comment.