Well, of course you can have few indent levels by just not indenting, I don’t think the readability loss is worth it though. If I had give up some indentation, I’d probably not indent the impl {} blocks.
Well, of course you can have few indent levels by just not indenting, I don’t think the readability loss is worth it though. If I had give up some indentation, I’d probably not indent the impl {} blocks.
Why have an async block spanning the whole function when you can mark the function as async? That’s 1 less level of indentation. Also, this quite is unusable for rust. A single match statement inside a function inside an impl is already 4 levels of indentation.
Well, it’s the same in rust, that’s why I agree more with the first interpretation.
There is an existing solution in C/C++, just make some binding and call it *.rs
Both python and rust use py and rs in the same way, to signal that it’s the python/rust version of that library.
Of course, there are exceptions, but that’s what usually happens.
Yeah, no python package has “py”, JavaScript “.js” or java “java”. None at all.
Idk how actix works, but if there is no other way around it, you’ll have to store pstmt in some kind of global state. Maybe in a global Vec or HashMap that stores unfinished streams.
I don’t think the problem is in the closure itself, since pstmt isn’t used inside the closure. To me, it looks like rec_iter has the lifetime of pstmt.
pstmt is dropped at the end of the function. However, rec_iter isn’t dropped at the end of the function (it is returned). You should either pass pstmt from outside the function as a reference and have zknotestream a lifetime smaller than pstmt, or return pstmt along with rec_iter. Idk if the last option is detected by rust though.
GPL libraries have an advantage in their legal power. MIT libraries have an advantage when users have to choose between 2 libraries.
All other things being equal, users will use more permissive libraries. So unless maintainers put more effort into the GPL, a MIT one will gather more users, which attracts more maintainers, which ends up in more MIT libraries than GPL ones existing.
I didn’t know that the difference between LGPL and GPL is that it allows to statically link. Then idk the reason
Probably because rust links statically by default, so making a library gpl means users will be forced to make their project GPL too, so MIT libraries have an incredible advantage.
IANAL though, so idk.
Yeah, that seems like it would work! Unfortunately I can’t use unstable features. I’ll keep it in mind for other projects though.
I’m sorry, no wonder you are lost, so it made no sense when you wrote this comment, lemmy deleted everything between the “less than” character and “>”. I had to change them for “<” in order for them not to get deleted.
In tip #3 I don’t see any benefit of doing impl AsRef<[T]> over &[T]
The lifetime extension is huge.