[−][src]Macro totems::assert_contains
Asserts that an item is contained within a collection.
Parameters
&collectionA reference to a collection.&itemA reference to an item to compare to items in the collection.
Dependencies
collectionmust implement Iterator.&collectionmust implement IntoIterator.itemmust implement PartialEq for the types incollection.
Example
use totems::assert_contains; let vec = vec![1, 3, 5, 7, 9, 11, 13, 15, 17, 19]; let x = 5; assert_contains!(&vec, &x);
Example Error Messages
thread 'main' panicked at 'assertion failed: (collection contains item)
item: 2
collection: [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
', src/collections.rs:149:9