Whole-known-network
Keep calm and carrion
<p><span class="h-card" translate="no"><a href="https://mi.yumechi.jp/@yume" class="u-url mention">@<span>yume</span></a></span> There is no input lifetime to refer to in my actual use case.</p><p>if there was, I wouldnโt need to ask the question.</p><p>The HRTB is indeed there because the lifetime โs is that of a local in the body of the function</p>
@twinspin6@outerheaven.club the salmon onigiri i just ate brought back childhood memories :ablobcatheart:
<p><span class="h-card" translate="no"><a href="https://social.linux.pizza/@gigantos" class="u-url mention">@<span>gigantos</span></a></span> Very confused about your mention of &โstatic Self, how is that related to the question at all?</p>
@fasterthanlime@hachyderm.io Is there any specific reason you used a higher-ranked bound?
By saying `for <'s> T: MyTrait<'s>` you are saying "T must be able to be used as MyTrait for every possible lifetime (which includes 'static). The string you have is not static, so Rust tell you it's not general enough.
This compiles and should give you the same result:
```rs
fn deser_and_staticify<'s, T>(
s: &'s str,
) -> Result<<T as IntoStatic>::Output, merde_json::MerdeJsonError<'static>>
where
T: ValueDeserialize<'s> + IntoStatic,
{
let deserialized: T = merde_json::from_str_via_value(&s).map_err(|e| e.to_static())?;
Ok(deserialized.into_static())
```
yesterday i had the best melonpan and the best unagi nigiri iโve ever had in my life - just by casually walking around and finding them :02lurk:
<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@fasterthanlime" class="u-url mention">@<span>fasterthanlime</span></a></span> and I guess you have a good reason not to simply return &'static Self. For example Self itself being a reference.</p><p>How about requiring something like</p><p>type Output: AsRef<Self> + 'static</p><p>It would at least limit it to types that are almost the same ๐ค</p>
@zonk@shitposter.world some japanese dude with a wife and two kids