We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
#[must_use]
array::repeat
1 parent 64a99db commit a44b180Copy full SHA for a44b180
library/core/src/array/mod.rs
@@ -48,6 +48,7 @@ pub use iter::IntoIter;
48
/// assert_eq!(strings, ["Hello there!", "Hello there!"]);
49
/// ```
50
#[inline]
51
+#[must_use = "cloning is often expensive and is not expected to have side effects"]
52
#[stable(feature = "array_repeat", since = "CURRENT_RUSTC_VERSION")]
53
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
54
from_trusted_iterator(repeat_n(val, N))
0 commit comments