writeln!(w, "impl Drop for {} {{", mangled_container).unwrap();
writeln!(w, "\tfn drop(&mut self) {{").unwrap();
writeln!(w, "\t\tif self.datalen == 0 {{ return; }}").unwrap();
- writeln!(w, "\t\tunsafe {{ Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }};").unwrap();
+ writeln!(w, "\t\tlet _ = unsafe {{ Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }};").unwrap();
writeln!(w, "\t}}").unwrap();
writeln!(w, "}}").unwrap();
if clonable {
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
- let doc = format!("{}", lit);
+ let doc = format!("{}", lit).trim().replace("\n", &format!("\n{}//!", prefix));
writeln!(w, "{}//!{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
- let doc = format!("{}", lit);
+ let doc = format!("{}", lit).trim().replace("\n", &format!("\n{}///", prefix));
writeln!(w, "{}///{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),