fix: some clippy (#677)
parent
1c3bcf7b23
commit
5799884862
|
@ -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 {
|
||||||
|
|
|
@ -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(""", "").replace("\"", "");
|
let r = i.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").replace('\"', "");
|
||||||
tc = tc.item_type_identifier(r);
|
tc = tc.item_type_identifier(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(""", "").replace("\"", "");
|
let r = i.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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(""", "").replace("\"", "");
|
let r = r.replace(""", "").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() {
|
||||||
|
|
Loading…
Reference in New Issue