Skip to content

Commit f0d34c9

Browse files
committed
fix: test assertions expecting different values
not sleeping is not good.
1 parent c19f87a commit f0d34c9

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

library/std/src/macros.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)