We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb78a9b commit 0a5fd1dCopy full SHA for 0a5fd1d
src/vec.rs
@@ -1600,6 +1600,23 @@ mod tests {
1600
assert_eq!(v.as_slice(), &[1, 2, 3]);
1601
}
1602
1603
+ #[test]
1604
+ fn from_array_no_drop() {
1605
+ struct Drops(Option<u8>);
1606
+
1607
+ impl Drop for Drops {
1608
+ fn drop(&mut self) {
1609
+ self.0 = None;
1610
+ }
1611
1612
1613
+ let v: Vec<Drops, 3> = Vec::from([Drops(Some(1)), Drops(Some(2)), Drops(Some(3))]);
1614
1615
+ assert_eq!(v[0].0, Some(1));
1616
+ assert_eq!(v[1].0, Some(2));
1617
+ assert_eq!(v[2].0, Some(3));
1618
1619
1620
#[test]
1621
fn starts_with() {
1622
let v: Vec<_, 8> = Vec::from_slice(b"ab").unwrap();
0 commit comments