Does the People(Vec) even work if you don’t specify the type inside the Vec?
Does the People(Vec) even work if you don’t specify the type inside the Vec?
Can’t you just use the get_or_init
method instead of get
inside the push_log
method? This would initialize the cell on first use. You’d still need a Mutex inside of it to acquire a mutable reference to the vector.
I don’t think oli-obk has any say in this as they stated the following:
Because this crate is owned by dtolnay and he may do with it as he wishes. My personal opinions on the topic are irrelevant.
Unless I’m missing something, I think you can clean it up and keep your static dispatch by turning the Driver struct into a trait:
You’d rename your struct Driver
to struct DriverImpl
, define a trait Driver
and for the implementation you’d use impl Driver for DriverImpl where etc...
Interesting, I did not expect them to meet SIL4 standards, that’s not an easy achievement.