If I have a method that consumes self
and takes in a closure:
impl Something {
pub fn finalize(self, f: F)
where
F: Fn(&Self)
{
// do stuff
f(&self);
// do more stuff
}
}
That Fn
should be FnOnce
. (There are also a case of an FnMut
that should be FnOnce
as well, where the situation is near identical).
The bad closure types are old copy'n'paste errors -- they were always meant to be FnOnce
. Assuming no one looked at the code an thought "Neat, I can allocate a single closure and pass it to multiple finalize()
calls", are there any situations where simply converting these to FnOnce
without bumping breaking change semver version would cause a problem?
How dragged would one be if one just fixed those {Fn
, FnMut
} → FnOnce
, yanked the old crate (to explicitly denote that it wasn't really a breaking change, it was rather an error in the old crate)?
(For Reasons(tm) I really want to avoid bumping the version number beyond the minor version at this point in time).