pub fn alloc_str<'a>(s : String, ctx : &mut impl IsCtx<'a>) -> Ptr<'a, String> {
    if let Some(dupe_ptr) = ctx.env_store().strings.check_dupe(&s)
                            .or_else(|| ctx.live_store().and_then(|st| st.strings.check_dupe(&s))) {
        dupe_ptr
    } else {
        ctx.mut_store().strings.insert_elem(s)

    }
}
// Strings are a pain since they're the only type we deal with
// that isn't copy.
Strings are a pain since they're the only type we deal with
that isn't copy.
Strings are a pain since they ' re the only type we deal with that isn ' t copy .
pub fn alloc_str<'a>(s : String, ctx : &mut impl IsCtx<'a>) -> Ptr<'a, String> {
    if let Some(dupe_ptr) = ctx.env_store().strings.check_dupe(&s)
                            .or_else(|| ctx.live_store().and_then(|st| st.strings.check_dupe(&s))) {
        dupe_ptr
    } else {
        ctx.mut_store().strings.insert_elem(s)
    }
}
pub fn alloc_str < ' a > ( s : String , ctx : & mut impl IsCtx < ' a > ) -> Ptr < ' a , String > { if let Some ( dupe_ptr ) = ctx . env_store ( ) . strings . check_dupe ( & s ) . or_else ( | | ctx . live_store ( ) . and_then ( | st | st . strings . check_dupe ( & s ) ) ) { dupe_ptr } else { ctx . mut_store ( ) . strings . insert_elem ( s ) } }
Strings are a pain since they're the only type we deal with
that isn't copy.
Strings are a pain since they ' re the only type we deal with that isn ' t copy .
s
String
ctx
&mut impl IsCtx<'a>
s
String
ctx
&mut impl IsCtx<'a>