News for hackers. Stuff that matters.
Re:Implementing a Type-safe printf in Rust by perryizgr8 on Friday August 14, 2020 @04:02AM (#24155137)
One thing I don't like about the macro is that it looks like the passed variable has been borrowed and you can't use it again. But that's not true. You can use it again and again even though you passed by value.
Re:Implementing a Type-safe printf in Rust by mqus on Tuesday August 18, 2020 @06:23AM (#24197065)
Well, the variables are only borrowed for the short time it takes to print that line. The borrow is terminated as soon as the print is finished. Because the println! macro does not return anything, there is no reason to extend the borrow.