File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -412,16 +412,8 @@ macro_rules! repetition_utils {
412412/// "key1" => "value1"
413413/// };
414414///
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- /// );
415+ /// assert_eq!(map.get("key"), Some(&"value"));
416+ /// assert_eq!(map.get("key1"), Some(&"value1"));
425417/// ```
426418///
427419/// This macro also supports trailing comma.
@@ -433,11 +425,7 @@ macro_rules! repetition_utils {
433425/// "key" => "value", // notice the ,
434426/// };
435427///
436- /// assert_eq!(
437- /// map.get("key")
438- /// .expect("Key to be associated to a value"),
439- /// "value"
440- /// );
428+ /// assert_eq!(map.get("key"), Some(&"value"));
441429/// ```
442430///
443431/// The key and value are moved into the HashMap.
@@ -455,7 +443,7 @@ macro_rules! hash_map {
455443
456444 ( $( $key: expr => $value: expr ) ,* $( , ) ? ) => { {
457445 let mut map = $crate:: collections:: HashMap :: with_capacity(
458- const { $crate:: repetition_utils( @count $( $key) ,* ) }
446+ const { $crate:: repetition_utils! ( @count $( $key) ,* ) }
459447 ) ;
460448 $( map. insert( $key, $value) ; ) *
461449 map
You can’t perform that action at this time.
0 commit comments