mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
refactor(mimefactory): use iter::repeat_with instead of (0..)
This commit is contained in:
committed by
holger krekel
parent
01df2e2dc7
commit
980bb35441
@@ -1010,8 +1010,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
fn wrapped_base64_encode(buf: &[u8]) -> String {
|
||||
let base64 = base64::encode(&buf);
|
||||
let mut chars = base64.chars();
|
||||
(0..)
|
||||
.map(|_| chars.by_ref().take(78).collect::<String>())
|
||||
std::iter::repeat_with(|| chars.by_ref().take(78).collect::<String>())
|
||||
.take_while(|s| !s.is_empty())
|
||||
.collect::<Vec<_>>()
|
||||
.join("\r\n")
|
||||
|
||||
Reference in New Issue
Block a user