anyone got a clue what's going on here?

i know what the error message means, but i don't understand what causes `'static` lifetime to be required, considering I've explicitly specified the `'a`.

there's this answer users.rust-lang.org/t/box-with but it's from 2019 - did the language change?

what am i overlooking?

#rust #rustlang #lifetime #bug

@unspeaker er. that is weird.

disclaimer: i would fumble around on this, i'm not confident i know what is causing this

does it have anything to do with deconstructing the box interior? since it's on the heap? is it possible you could pop something out of `Collection::Box` as a separate function or in a bracket expression so rustc knows that the box is out of scope when it goes for the interior value?

@ironchamber

hmm, i'm not sure i'm parsing your suggestion. is "pop something out" something that i should try doing, or is it a possibility that i need to account for?

the goal is to compose `Render`able widgets inside the `render` method of other widgets

Collected::Box is for when they are ephemeral (owned by the render method) and Collected::Ref is for when they are stateful (owned by the parent struct), if that makes sense

@ironchamber

and this is based on some old code that used to work quite nicely for that purpose ... but i can't reuse it because reasons :(

@unspeaker haha I've been using ratatui a bit, it definitely is more of a tool kit than a framework, lots of boilerplate left on the table imo

@ironchamber

yeah.. the only thing I like about ratatui really is the double buffering

a couple years back i wrote my own framework on top of crossterm as was quite happy with how it let me compose things

generic over backend too (business logic could theoretically be reused with a gui backend instead of tui)

but i put it on github. and then something something trauma ostracism paranoia so now i can't reuse stuff that i've published on github because it's too connected with my past identity

@ironchamber

on one hand who's gonna doxx me over reusing my old code, and what's the chance they're gonna do anything to me - on the other even if the chance is minuscule the consequences would be beyond what i can deal with currently - so let's rewrite everything from scratch but worse ๐Ÿคฃ

Follow

@unspeaker
> on one hand who's gonna doxx me over reusing my old code, and what's the chance they're gonna do anything to me
Just make up a story how you stumbled upon that code on GH on random one day and forked it!
To keep yourself calm and as a coverup story just in case ๐Ÿ˜‰
Problem solved ๐Ÿ˜Ž
@ironchamber

ยท bloat ยท 0 ยท 0 ยท 1
Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml