Before we got rid of the macro, this was handled by the way the `{}`
were embedded in the format string.
Then it was present in the source, stripped by LitLinesCrlf and then
added back by lines_crlf. Now it is only handled by lines_crlf and
everything is reasonably straightforward.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
/// Displays as the lines of `s`, deindented, with CRLFs
///
-/// TODO has anomalous handling of the last line.
+/// Missing trailing newline turns into missing trailing `\r\n`
pub struct LitLinesCrlf<'s>(pub &'s str);
impl Display for LitLinesCrlf<'_> {
.flatten()
.collect::<String>();
- let output = output.strip_suffix("\r\n").expect("XXXX bad input");
write!(f, "{output}")
}
}
r#"--b
Content-Type: text/plain; charset="utf-8"
Content-Disposition: form-data; name="m"
-
"#),
&c.ic.link.client,
token,
--b
Content-Type: application/octet-stream
Content-Disposition: form-data; name="d"
-
"#),
);
let suffix = lines_crlf!(&LitLinesCrlf(
r#"
- --b--
- "#),
+ --b--"#),
);
macro_rules! content { {