2023 Feb 09
So it seems automated retries are necessary for trampoline. But I’m wondering, could a user have implemented that themselves before..? Regardless it makes sense for LDK to supoort it internally instead of making users do that.
Reviewed another PR!
Match guards - add conditions to match
Unsafe just means compiler isn’t checking for certain things like needing mutable references to modify things. It’s actually common to use unsafe rust for optimizations when you can prove soundness of it’s usage.
Monads. Still don’t totally understand the more theoretical functional programming side of things, but I learned to look for concise helpful functions on wrapped types like
Option
andResult
to avoid having to unwrap to do stuff.Rayon for some helpful parallelism tools.
&impl Trait
should be the default when taking a type that implements a trait as a parameter. Often people will use generics with trait constraints, but these are less readable.Be careful with
Deref
! You can call a method of the inner type on aArc<_>
just using the normal dot notation because it implementsDeref
. However note: if the inner type implements something likeClone
, calling.clone()
will call the inner type’s clone method, and instead you may want to useArc::clone(_)
!