David Tolnay

Results 700 comments of David Tolnay

I was stuck on this too but I found a zero allocation way: ```rust async fn is_even(input: i32) -> bool { use is_odd::IsOdd; let exponent_mask = 0x7F800000; let significand_mask =...

Workaround: `rustup run nightly cargo-osha`.

> The program crashes when trying to serialize them Is this a crash or does serde_cbor return an error?

I don't think renaming is possible but the next time you release a breaking change (0.7.0) you can publish it as prettytable instead of prettytable-rs.

Yeah this would be #96455; it's the "needs_late_drop" due to "custom signature for write_fmt" situation described in https://github.com/rust-lang/rust/pull/96455#issuecomment-1110522350. https://docs.rs/async-std/latest/async_std/io/prelude/trait.WriteExt.html#method.write_fmt ```rust fn write_fmt where Self: Unpin; ``` IMO this signature obviously...

Sadly I think that combination might be impossible to implement (from a brief attempt) and we'll end up forced to drop the format args of `write!` and `writeln!` late as...

Some nonworking implementations: ```rust // Causes $dst to be moved, so you can only write to it once. // The correct behavior requires an autoref on $dst. macro_rules! write {...

I put up a revert for now in #99689.

@eddyb I tried coding up your suggestion (ddaa6e7b498e81ca93a667e7ebdbca677d048a50) but it failed `x.py install` with code like [this](https://github.com/tokio-rs/tracing/blob/tracing-subscriber-0.3.3/tracing-subscriber/src/fmt/format/mod.rs#L922-L927): ```rust write!( writer, "{}{} ", writer.bold().paint(meta.target()), writer.dimmed().paint(":") )?; ``` ```console error[E0502]: cannot borrow...

Yes Josh, I believe that could be defined in such a way as to work here. It'd be: ```rust #[macro_export] macro_rules! write { ($dst:expr, $($arg:tt)*) => { match $dst {...