You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This block means you can just implement the Contain type inside specified module; then, due to same for both specified and computed, you can just export (pub use) the specified type in computed module. You can check this PR. I think they're not same but similar.
Yes, but in this case, since the types are the same, it's completely redundant to use computed_value::T instead of Self. This is the kind of stuff we're trying to remove :)
Activity
emilio commentedon Dec 30, 2017
Tentatively assigning it to @stevel98 :)
stevel98 commentedon Dec 31, 2017
Hi,
I'm still new to rust, and I'm puzzled over the purpose of the
computed_valuemodule under thecontainslonghand inbox.mako.rs.I only see it used in:
But wouldn't this be the same as:
CYBAI commentedon Dec 31, 2017
@stevel98
This block means you can just implement the
Containtype insidespecifiedmodule; then, due to same for bothspecifiedandcomputed, you can just export (pub use) thespecifiedtype incomputedmodule. You can check this PR. I think they're not same but similar.For this block, yeah, you can use
Self::empty().Another note:
For this case, I didn't try but maybe you don't need this
get_initial_valuefunction? I think you can just useemptyforinitial_value?cc @emilio
If I'm wrong, please correct me :P
emilio commentedon Dec 31, 2017
Yes, but in this case, since the types are the same, it's completely redundant to use
computed_value::Tinstead ofSelf. This is the kind of stuff we're trying to remove :)stevel98 commentedon Dec 31, 2017
Thanks! I'll try to remove it then.
Auto merge of #19682 - stevel98:moveContain, r=emilio
Auto merge of #19682 - stevel98:moveContain, r=emilio