D7791: rust-nodemap: NodeMap trait with simplest implementor
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Tue Jan 21 17:17:17 EST 2020
Alphare added inline comments.
INLINE COMMENTS
> martinvonz wrote in nodemap.rs:150
> I find `Deref<Target = [Block]> + Send` hard to understand. I think it would be helpful to name it. Could we at least define an alias for it?
>
> Perhaps it's even better to define a trait for it and add named methods on that, but if those methods would just be `len()` and `index()` it probably doesn't make any sense to define the trait.
> I find Deref<Target = [Block]> + Send hard to understand. I think it would be helpful to name it. Could we at least define an alias for it?
Alas, trait aliases are not stable: rust#55628 <https://github.com/rust-lang/rust/issues/55628>.
On a more subjective note, I find this syntax quite readable as it is (as readable as Rust usually is), and since this is a single occurrence in a private field, I find it reasonable.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7791/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7791
To: gracinet, #hg-reviewers, kevincox
Cc: Alphare, martinvonz, durin42, kevincox, mercurial-devel
More information about the Mercurial-devel
mailing list