2
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:
mood
Attached image 0
<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 &amp;โ€™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 &amp;&#39;static Self. For example Self itself being a reference.</p><p>How about requiring something like</p><p>type Output: AsRef&lt;Self&gt; + &#39;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