(text: &str)
| 1195 | } |
| 1196 | |
| 1197 | fn truncate_preview(text: &str) -> String { |
| 1198 | if text.chars().count() <= MAX_OUTPUT_PREVIEW_CHARS { |
| 1199 | return text.to_string(); |
| 1200 | } |
| 1201 | |
| 1202 | let truncated: String = text.chars().take(MAX_OUTPUT_PREVIEW_CHARS).collect(); |
| 1203 | format!("{}...", truncated) |
| 1204 | } |
| 1205 | |
| 1206 | fn market_description_cache() -> &'static RwLock<HashMap<String, String>> { |
| 1207 | MARKET_DESCRIPTION_CACHE.get_or_init(|| RwLock::new(HashMap::new())) |
no test coverage detected