Skip to content

Commit 3751b5d

Browse files
committed
removed tests from function doc string
1 parent b69db01 commit 3751b5d

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

library/core/src/iter/traits/iterator.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,50 +4078,6 @@ pub trait Iterator {
40784078
/// assert!([Some(2), None].iter().contain(&Some(2)));
40794079
/// ```
40804080
///
4081-
/// Tests:
4082-
/// Happy path 1 - the item is in the iterator
4083-
/// ```
4084-
/// #![feature(contains)]
4085-
/// assert!([1, 2, 3].iter().contain(&1));
4086-
/// ```
4087-
/// Happy path 2 - the item is not in the iterator
4088-
/// ```
4089-
/// #![feature(contains)]
4090-
/// assert!(![1, 2, 3].iter().contain(&4));
4091-
/// ```
4092-
/// Edge case 1 - handling None values
4093-
/// ```
4094-
/// #![feature(contains)]
4095-
/// let mut iter = [Some(2), None].iter();
4096-
/// assert!([Some(2), None].iter().contain(&None));
4097-
/// assert!([Some(2), None].iter().contain(&Some(2)));
4098-
/// ```
4099-
/// Edge case 2 - handling empty iterator
4100-
/// ```
4101-
/// #![feature(contains)]
4102-
/// let mut iter: Vec<i32> = vec![];
4103-
/// assert!(!vec![].iter().contain(&1));
4104-
/// ```
4105-
/// Edge case 3 - handling iterator with duplicates
4106-
/// ```
4107-
/// #![feature(contains)]
4108-
/// let mut iter = [1, 2, 2, 3].iter();
4109-
/// assert!(iter.contain(&2));
4110-
/// ```
4111-
/// Edge case 4 - handling iterator with custom struct
4112-
/// ```
4113-
/// #![feature(contains)]
4114-
/// #[derive(PartialEq)]
4115-
/// struct Item {
4116-
/// value: i32,
4117-
/// }
4118-
/// assert!([Item { value: 1 }, Item { value: 2 }].iter().contain(&Item { value: 2 }));
4119-
/// ```
4120-
/// Edge case 5 - handling iterator with large number of elements
4121-
/// ```
4122-
/// #![feature(contains)]
4123-
/// assert!((1..1000).contain(&500));
4124-
/// ```
41254081
#[unstable(feature = "contains", reason = "new API", issue = "127494")]
41264082
fn contain<Q: Sized>(&mut self, item: Q) -> bool
41274083
where

0 commit comments

Comments
 (0)