(input: &str, max_chars: usize)
| 2228 | } |
| 2229 | |
| 2230 | fn truncate_text(input: &str, max_chars: usize) -> String { |
| 2231 | if input.chars().count() <= max_chars { |
| 2232 | return input.to_string(); |
| 2233 | } |
| 2234 | let mut out = String::new(); |
| 2235 | for c in input.chars().take(max_chars.saturating_sub(2)) { |
| 2236 | out.push(c); |
| 2237 | } |
| 2238 | out.push_str(".."); |
| 2239 | out |
| 2240 | } |
| 2241 | |
| 2242 | fn local_database_path() -> PathBuf { |
| 2243 | dirs::data_local_dir() |
no test coverage detected