about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-04-04 19:19:59 +0200
committerGitHub <noreply@github.com>2021-04-04 19:19:59 +0200
commit869726d335cff08c1673045a6566f1dca07b305a (patch)
tree9d265e3ca475f1a35da5976f5906a69f68b184f7 /library/alloc
parenta1c34493d4d733fedf2a8609d7426a425eb7cf84 (diff)
parent2fb56cc123cc1111cff2803ab7df26a0f0941fae (diff)
downloadrust-869726d335cff08c1673045a6566f1dca07b305a.tar.gz
rust-869726d335cff08c1673045a6566f1dca07b305a.zip
Rollup merge of #81619 - SkiFire13:resultshunt-inplace, r=the8472
Implement `SourceIterator` and `InPlaceIterable` for `ResultShunt`
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/tests/vec.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index b926c697d58..d208bd8ce58 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -1004,9 +1004,9 @@ fn test_from_iter_specialization_with_iterator_adapters() {
         .map_while(Option::Some)
         .peekable()
         .skip(1)
-        .map(|e| std::num::NonZeroUsize::new(e));
+        .map(|e| if e != usize::MAX { Ok(std::num::NonZeroUsize::new(e)) } else { Err(()) });
     assert_in_place_trait(&iter);
-    let sink = iter.collect::<Vec<_>>();
+    let sink = iter.collect::<Result<Vec<_>, _>>().unwrap();
     let sinkptr = sink.as_ptr();
     assert_eq!(srcptr, sinkptr as *const usize);
 }