Alex Saveau

Results 424 comments of Alex Saveau

Mmmm, yeah you're right. But still, you wouldn't be able to use `fmt_adapter` in here for example: https://github.com/rust-lang/rust/blob/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/std/src/io/mod.rs#L1661. So it seems better to not add unnecessary restrictions. Also putting `fmt_adapter`...

Are you sure? I can't get it to work: ```diff Subject: [PATCH] Add fmt::Write to io::Write adapter Signed-off-by: Alex Saveau --- Index: library/std/src/io/mod.rs IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP UTF-8 ===================================================================...

Wow, that's a mind bender, no idea you could do that. Thanks everybody!

Another use case for this came up: if a method accepts a `fmt::Write`r, there's no way to use the io combinators which means you have to write your own. With...

Yeah, I brushed that under the rug, but I think you're right. I'll see if I can figure it out in the next few weeks and then this should be...

Nah, that doesn't cut it because we know the underlying error is an `io::Error`. Basically we need a way to let you check the error and choose to restart writing,...

That's too complicated IMO. Here's what I was thinking of: ``` fn do_stuff() -> io::Result { fn my_common_writer(output: &mut impl fmt::Write) -> fmt::Result { writeln!(output, "Hello World!") } let mut...

Nah, even that's too complicated. Let's just do this: ``` impl FmtWriteAdapter

Do you have any specific use cases in mind? My beef with the lambda is that it will make complicated control flow messy. As for `into_fmt_write`, it will force boilerplate...

> Whether rustix or another crate is the best option for that, I don't know Fair point. I'm biased towards liking rustix (have made contributions), so I think I'll still...