Skip to content

Commit 05154af

Browse files
committed
docs: update documentation of core::mem::copy to include const on the fn signature
1 parent a9fb610 commit 05154af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ pub fn drop<T>(_x: T) {}
960960
///
961961
/// This function is not magic; it is literally defined as
962962
/// ```
963-
/// pub fn copy<T: Copy>(x: &T) -> T { *x }
963+
/// pub const fn copy<T: Copy>(x: &T) -> T { *x }
964964
/// ```
965965
///
966966
/// It is useful when you want to pass a function pointer to a combinator, rather than defining a new closure.

0 commit comments

Comments
 (0)