Few more minor changes to formatting.

This commit is contained in:
Hiers 2023-03-04 13:18:04 +00:00
parent 556c32b1ec
commit 321aab0480

View file

@ -216,7 +216,7 @@ fn format_sense(value: &Value, index: usize, prev_parts_of_speech: &mut String)
// Do not repeat a meaning's part of speech if it is the same as the previous meaning // Do not repeat a meaning's part of speech if it is the same as the previous meaning
if !parts.is_empty() && parts != *prev_parts_of_speech { if !parts.is_empty() && parts != *prev_parts_of_speech {
*prev_parts_of_speech = parts.clone(); *prev_parts_of_speech = parts.clone();
format!("[{}]\n ", parts.bright_blue()) format!("{}\n ", parts.bright_blue())
} else { } else {
String::new() String::new()
} }
@ -230,12 +230,13 @@ fn format_sense(value: &Value, index: usize, prev_parts_of_speech: &mut String)
true true
}; };
let index_str = format!("{}.",(index + 1));
let tags = format_sense_tags(value); let tags = format_sense_tags(value);
(format!( (format!(
"{}{}. {} {}", "{}{} {} {}",
parts_of_speech, parts_of_speech,
(index + 1).to_string().bright_black(), index_str.bright_black(),
english_definiton english_definiton
.iter() .iter()
.map(|i| value_to_str(i)) .map(|i| value_to_str(i))