Closed CeleritasCelery closed 2 years ago
I updated based on feedback and renamed the feature to lcell_macro
.
This looks fine, thanks -- and thanks to @geeklint for reviewing before I got to it. Re-exporting generativity is okay, to allow a caller to use exactly the same version that qcell is using (although it seems pretty stable).
Effectively you're just importing the lifetime from generativity's Guard
and using qcell's implementation of Id
, which should be fine.
I will add new doctests to test this more thoroughly just now.
I have doctests working, and everything seems okay. The error messages with generativity's approach if you misuse an owner are way more confusing (e.g. if you confuse which owner is for which cell). It says that "tag
is dropped while still borrowed" (which is not really true), and that the tag does not live long enough -- and that's all. With the scope version, you can see that it is thrashing about trying to resolve some impossible lifetime situation, explaining that in depth, and it even points to the line causing the problem. So I guess generativity is slightly less beginner-friendly in terms of compiler errors.
It's published (version 0.5.1)
Closes #31
I was able to avoid the issue of conflicting implementation of
'id
by just reusing the lifetime inPhantomData
. Let me know what you think of how I exportedgenerativity
. I added it as a namespace underqcell
.Also fixed a clippy lint.