]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/option.rs
Auto merge of #69576 - matthiaskrgr:nightly_bootstrap_from_beta, r=Centril
[rust.git] / src / libcore / option.rs
index c7b36d8ad6362f1e2cdb6fd7d4f93b34dd4a6e4c..9b32442371c37a32c77577b8e66e2f6551972911 100644 (file)
@@ -461,6 +461,12 @@ pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
     /// Applies a function to the contained value (if any),
     /// or returns the provided default (if not).
     ///
+    /// Arguments passed to `map_or` are eagerly evaluated; if you are passing
+    /// the result of a function call, it is recommended to use [`map_or_else`],
+    /// which is lazily evaluated.
+    ///
+    /// [`map_or_else`]: #method.map_or_else
+    ///
     /// # Examples
     ///
     /// ```