Closed
Description
In 1.0.0-rc.1, the new Timer
trait has a method to reset an existing Sleep
to a new deadline. The default implementation simply creates a new Sleep
and writes it over the old one, but presumably this method exists to it can be overridden with a better implementation when working with a timer like Tokio's that can have its deadline dynamically adjusted.
However, since the Sleep
is provided as a dyn Sleep
and Sleep
has no downcasting APIs, there is no safe way to confirm that the Sleep
instance is one created by this Timer
implementation. That effectively means that the current default implementation is the only sound way of implementing the method.