fix: some clippy (#677)

main
bokuweb 2024-02-09 19:23:51 +09:00 committed by GitHub
parent 1c3bcf7b23
commit 5799884862
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -54,7 +54,7 @@ impl std::str::FromStr for InstrHyperlink {
let _ = s.next(); let _ = s.next();
} }
_ => { _ => {
target = i.replace(""", "").replace("\"", "").to_string(); target = i.replace(""", "").replace('\"', "").to_string();
} }
} }
} else { } else {

View File

@ -59,7 +59,7 @@ impl BuildXML for InstrTC {
} }
fn parse_level(i: &str) -> Option<usize> { fn parse_level(i: &str) -> Option<usize> {
let r = i.replace("&quot;", "").replace("\"", ""); let r = i.replace("&quot;", "").replace('\"', "");
if let Ok(l) = usize::from_str(&r) { if let Ok(l) = usize::from_str(&r) {
return Some(l); return Some(l);
} }
@ -78,7 +78,7 @@ impl std::str::FromStr for InstrTC {
match i { match i {
"\\f" => { "\\f" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
tc = tc.item_type_identifier(r); tc = tc.item_type_identifier(r);
} }
} }

View File

@ -253,7 +253,7 @@ impl BuildXML for InstrToC {
} }
fn parse_level_range(i: &str) -> Option<(usize, usize)> { fn parse_level_range(i: &str) -> Option<(usize, usize)> {
let r = i.replace("&quot;", "").replace("\"", ""); let r = i.replace("&quot;", "").replace('\"', "");
let r: Vec<&str> = r.split('-').collect(); let r: Vec<&str> = r.split('-').collect();
if let Some(s) = r.get(0) { if let Some(s) = r.get(0) {
if let Ok(s) = usize::from_str(s) { if let Ok(s) = usize::from_str(s) {
@ -278,31 +278,31 @@ impl std::str::FromStr for InstrToC {
match i { match i {
"\\a" => { "\\a" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.caption_label(r); toc = toc.caption_label(r);
} }
} }
"\\b" => { "\\b" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.entry_bookmark_name(r); toc = toc.entry_bookmark_name(r);
} }
} }
"\\c" => { "\\c" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.caption_label_including_numbers(r); toc = toc.caption_label_including_numbers(r);
} }
} }
"\\d" => { "\\d" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.sequence_and_page_numbers_separator(r); toc = toc.sequence_and_page_numbers_separator(r);
} }
} }
"\\f" => { "\\f" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.tc_field_identifier(r); toc = toc.tc_field_identifier(r);
} }
} }
@ -330,19 +330,19 @@ impl std::str::FromStr for InstrToC {
} }
"\\p" => { "\\p" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.entry_and_page_number_separator(r); toc = toc.entry_and_page_number_separator(r);
} }
} }
"\\s" => { "\\s" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
toc = toc.seq_field_identifier_for_prefix(r); toc = toc.seq_field_identifier_for_prefix(r);
} }
} }
"\\t" => { "\\t" => {
if let Some(r) = s.next() { if let Some(r) = s.next() {
let r = r.replace("&quot;", "").replace("\"", ""); let r = r.replace("&quot;", "").replace('\"', "");
let mut r = r.split(','); let mut r = r.split(',');
loop { loop {
if let Some(style) = r.next() { if let Some(style) = r.next() {