mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +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 {
|
fn wrapped_base64_encode(buf: &[u8]) -> String {
|
||||||
let base64 = base64::encode(&buf);
|
let base64 = base64::encode(&buf);
|
||||||
let mut chars = base64.chars();
|
let mut chars = base64.chars();
|
||||||
(0..)
|
std::iter::repeat_with(|| chars.by_ref().take(78).collect::<String>())
|
||||||
.map(|_| chars.by_ref().take(78).collect::<String>())
|
|
||||||
.take_while(|s| !s.is_empty())
|
.take_while(|s| !s.is_empty())
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("\r\n")
|
.join("\r\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user