mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
refactor: remove unused allow(clippy::indexing_slicing) from 'truncate'
This commit is contained in:
@@ -45,7 +45,6 @@ use crate::stock_str;
|
|||||||
|
|
||||||
/// Shortens a string to a specified length and adds "[...]" to the
|
/// Shortens a string to a specified length and adds "[...]" to the
|
||||||
/// end of the shortened string.
|
/// end of the shortened string.
|
||||||
#[allow(clippy::indexing_slicing)]
|
|
||||||
pub(crate) fn truncate(buf: &str, approx_chars: usize) -> Cow<str> {
|
pub(crate) fn truncate(buf: &str, approx_chars: usize) -> Cow<str> {
|
||||||
let count = buf.chars().count();
|
let count = buf.chars().count();
|
||||||
if count > approx_chars + DC_ELLIPSIS.len() {
|
if count > approx_chars + DC_ELLIPSIS.len() {
|
||||||
|
|||||||
Reference in New Issue
Block a user