clippy: a char array for the subtitle separators in main_title (manual_pattern_char_comparison)
This commit was merged in pull request #1.
This commit is contained in:
@@ -769,7 +769,7 @@ fn etext_of(body: &Value, gutenberg_id: u64) -> Etext {
|
|||||||
pub fn main_title(raw: &str) -> String {
|
pub fn main_title(raw: &str) -> String {
|
||||||
let lower = raw.to_lowercase();
|
let lower = raw.to_lowercase();
|
||||||
let head = lower
|
let head = lower
|
||||||
.split(|c: char| matches!(c, ';' | ':' | '(' | '['))
|
.split([';', ':', '(', '['])
|
||||||
.next()
|
.next()
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let head = head.find(", or").map_or(head, |i| &head[..i]);
|
let head = head.find(", or").map_or(head, |i| &head[..i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user