pub trait TupleRemove {
// Provided method
fn remove<const POS: usize>(self) -> Self::Output
where Self: TupleRemoveExact<POS> + Sized { ... }
}
Expand description
Remove a value from a tuple.
Unlike TupleRemoveExact
, this trait moves the const POS
to a method,
so it can be used with the help of type derivation
without explicitly declaring the underlying trait.
§Example
use rs_std_ext::tuple::TupleRemove;
let x = (10u8, 'a', -5i32);
let y = x.remove::<1>();
assert_eq!(y, (10u8, -5i32));