- 3 Posts
- 7 Comments
VegOwOtenks@lemmy.worldOPto
linuxmemes@lemmy.world•When I try to go on a ricing journey again
3·1 year agoThe extension is called Burn-My-Windows and I always look forward to it when booting into GNOME because it feels so ✨fancy✨
VegOwOtenks@lemmy.worldOPto
linuxmemes@lemmy.world•When I try to go on a ricing journey againEnglish
1·1 year agoI stumbled over Gradience just yesterday but I tought it was archived sometime last year, is it still working accordingly?
VegOwOtenks@lemmy.worldOPto
linuxmemes@lemmy.world•When I try to go on a ricing journey again
10·1 year agoUnfortunately not :/ But I do have rainbow-gradient window borders.
VegOwOtenks@lemmy.worldOPto
linuxmemes@lemmy.world•When I try to go on a ricing journey again
5·1 year agoI suppose you’re mainly concerned about LibAdwaita-Apps?
VegOwOtenks@lemmy.worldOPto
linuxmemes@lemmy.world•When I try to go on a ricing journey again
17·1 year agoI was surprised to learn that
- a) macOS only recently added Left/Right-tiling natively (without extensions, just like GNOME does)
- b) they leave gaps when you tile them so that it looks like you messed up the tiling somehow
VegOwOtenks@lemmy.worldto
Rust@programming.dev•[Help] Is there a way to detect all structs in the current crate that implement a certain trait?
1·2 years agoYou could wrap the entirety of your file in a monster macro but you’d still have to assign the macro result to a variable you need to register, which doesn’t sound viable to me at least.
Maybe you can use a script that would extract all the trait implementations and create the boilerplate glue code for you, something like this:
grep --recursive --only-matching "impl PluginFunction for \w*" functions/ | sed --quiet "s/functions\/\(.*\)\.rs:impl PluginFunction for \(\w*\)/crate::functions::\1::\2{}.register(\&mut functions_map)/p"I tried to recreate your situation locally but it may not match perfectly, maybe you’ll have to adjust it a little. When I run it on my file tree which looks like this
functions ├── attr.rs ├── export.rs └── render.rs 1 directory, 3 fileswhere every file has a content like this
// comment pub struct MyAttrStructName {} impl PluginFunction for MyAttrStructName { }Then I receive the following output:
crate::functions::attr::MyAttrStructName{}.register(&mut functions_map) crate::functions::export::MyExportStructName{}.register(&mut functions_map) crate::functions::render::MyRenderStructName{}.register(&mut functions_map)
Thanks, TIL