Lej77

Results 27 comments of Lej77

I made an attempt at implementing this: ```rust macro_rules! assert_variant { ($e:ty: $($v:ident),+ $(,)?) => { const _: fn($e) = |e| { type AnEnum = $e; $( if let AnEnum::$v...

I played around with making a macro that auto implements a trait that has methods like `fn as_wireguard(&self) -> Option`. My macro uses the [`impls`](https://crates.io/crates/impls) crate to determine if a...

I released a crate [`cast_trait_object`](https://crates.io/crates/cast_trait_object) that basically generalizes the macro I proposed previously. I also searched around for other similar crates and [wrote a section in the docs about them](https://docs.rs/cast_trait_object/0.1.1/cast_trait_object/#alternatives)...

I guess this would be accomplished with the derive macro. I have written a macro that can be used on a type and if the type implements a certain trait...

Your code assumes that the source error implements the `ErrorCompat` trait while my code doesn't. This means that the macro could only generate your code if the `ErrorCompat` trait is...

That would be a reasonable solution! The best option for keeping `Pin` support would probably be to add a new box type that can be pinned (`bumpalo::boxed::PinnedBox`?) which would store...

I wrote a helper function to update a menu item's text using the `windows` crate: ```rust use nwg::ControlHandle; /// Copied from [`native_windows_gui::win32::base_helper::to_utf16`]. fn to_utf16(s: &str) -> Vec { use std::ffi::OsStr;...

This seems similar to #1132 which also mentions copying as a HTML link.

I think that forgetting stack allocations is allowed by the pin docs as long as the stack memory is never re-used after it was forgotten. My example stack allocator does...

It does seem like forgettable stack pinning isn't used much so `scoped_async_spawn` should be compatible with most async crates and therefore it should be okay to keep using it. Also,...