MCPcopy Create free account
hub / github.com/Lokathor/tinyvec / from

Method from

src/arrayvec.rs:1430–1437  ·  view source on GitHub ↗

The output has a length equal to the full array. If you want to select a length, use [`from_array_len`](ArrayVec::from_array_len)

(data: A)

Source from the content-addressed store, hash-verified

1428 /// If you want to select a length, use
1429 /// [`from_array_len`](ArrayVec::from_array_len)
1430 fn from(data: A) -> Self {
1431 let len: u16 = data
1432 .as_slice()
1433 .len()
1434 .try_into()
1435 .expect("ArrayVec::from> length must be in range 0..=u16::MAX");
1436 Self { len, data }
1437 }
1438}
1439
1440/// The error type returned when a conversion from a slice to an [`ArrayVec`]

Callers

nothing calls this directly

Calls 2

lenMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected