Skip to content

Commit 4bee898

Browse files
committed
API: more appropriate parameter: FnMut -> FnOnce
1 parent a9307c9 commit 4bee898

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/os/custom

1 file changed

+1
-1
lines changed

library/std/src/os/custom/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ macro_rules! static_rwlock_box_impl {
7171
///
7272
/// Removing an implementation (i.e. setting the internal singleton to `None`)
7373
/// is intentionally not allowed.
74-
pub fn set_impl<F: FnMut(Option<Box<dyn $api>>) -> Box<dyn $api>>(mut transition: F) {
74+
pub fn set_impl<F: FnOnce(Option<Box<dyn $api>>) -> Box<dyn $api>>(transition: F) {
7575
let mut writer = IMPL.write().expect("poisoned lock");
7676
let maybe_impl = core::mem::replace(&mut *writer, None);
7777
let new_impl = transition(maybe_impl);

0 commit comments

Comments
 (0)