Once I had seen this function. It was a nice function, but there is a problem
pub fn encode_logs(logs: impl IntoIterator<Item = impl AsRef<str>>) -> String {
logs.into_iter().map(|line|
line.as_ref()
.replace("\\", "\\\\")
.replace("\n", "\\n")