File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -412,8 +412,16 @@ macro_rules! repetition_utils {
412412/// "key1" => "value1"
413413/// };
414414///
415- /// assert_eq!(map.get("key"), "value");
416- /// assert_eq!(map.get("key1"), "value1");
415+ /// assert_eq!(
416+ /// map.get("key")
417+ /// .expect("Key to be associated to a value"),
418+ /// "value"
419+ /// );
420+ /// assert_eq!(
421+ /// map.get("key1")
422+ /// .expect("Key to be associated to a value"),
423+ /// "value1"
424+ /// );
417425/// ```
418426///
419427/// This macro also supports trailing comma.
@@ -425,7 +433,11 @@ macro_rules! repetition_utils {
425433/// "key" => "value", // notice the ,
426434/// };
427435///
428- /// assert_eq!(map.get("key"), "value");
436+ /// assert_eq!(
437+ /// map.get("key")
438+ /// .expect("Key to be associated to a value"),
439+ /// "value"
440+ /// );
429441/// ```
430442///
431443/// The key and value are moved into the HashMap.
You can’t perform that action at this time.
0 commit comments