#[cfg(feature = "std")]
use std::ops;
#[cfg(not(feature = "std"))]
use core::ops;
use self::ops::{Index, IndexMut, Range, RangeFrom, RangeFull, RangeTo};
#[cfg(feature = "nightly")]
use self::ops::{RangeInclusive, RangeToInclusive};
#[cfg(feature = "nightly")]
pub trait IndexRanges<Idx>: Index<Range<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeTo<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFrom<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeInclusive<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeToInclusive<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFull>
{}
#[cfg(feature = "nightly")]
impl<T: ?Sized, Idx> IndexRanges<Idx> for T
where T: Index<Range<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeTo<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFrom<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeInclusive<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeToInclusive<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFull>
{}
#[cfg(not(feature = "nightly"))]
pub trait IndexRanges<Idx>: Index<Range<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeTo<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFrom<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFull>
{}
#[cfg(not(feature = "nightly"))]
impl<T: ?Sized, Idx> IndexRanges<Idx> for T
where T: Index<Range<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeTo<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFrom<Idx>, Output = <Self as Index<RangeFull>>::Output>
+ Index<RangeFull>
{}
#[cfg(feature = "nightly")]
pub trait IndexRangesMut<Idx>: IndexMut<Range<Idx>>
+ IndexMut<RangeTo<Idx>>
+ IndexMut<RangeFrom<Idx>>
+ IndexMut<RangeInclusive<Idx>>
+ IndexMut<RangeToInclusive<Idx>>
+ IndexMut<RangeFull>
+ IndexRanges<Idx>
{}
#[cfg(feature = "nightly")]
impl<T: ?Sized, Idx> IndexRangesMut<Idx> for T
where T: IndexMut<Range<Idx>>
+ IndexMut<RangeTo<Idx>>
+ IndexMut<RangeFrom<Idx>>
+ IndexMut<RangeInclusive<Idx>>
+ IndexMut<RangeToInclusive<Idx>>
+ IndexMut<RangeFull>
+ IndexRanges<Idx>
{}
#[cfg(not(feature = "nightly"))]
pub trait IndexRangesMut<Idx>: IndexMut<Range<Idx>>
+ IndexMut<RangeTo<Idx>>
+ IndexMut<RangeFrom<Idx>>
+ IndexMut<RangeFull>
+ IndexRanges<Idx>
{}
#[cfg(not(feature = "nightly"))]
impl<T: ?Sized, Idx> IndexRangesMut<Idx> for T
where T: IndexMut<Range<Idx>>
+ IndexMut<RangeTo<Idx>>
+ IndexMut<RangeFrom<Idx>>
+ IndexMut<RangeFull>
+ IndexRanges<Idx>
{}
pub trait SplitAt<Idx>: IndexRanges<Idx> {
fn split_at(&self, index: Idx) -> (&<Self as Index<RangeFull>>::Output, &<Self as Index<RangeFull>>::Output);
}
pub trait SplitAtMut<Idx>: IndexRangesMut<Idx> + SplitAt<Idx> {
fn split_at_mut(&mut self, index: Idx) -> (&mut <Self as Index<RangeFull>>::Output, &mut <Self as Index<RangeFull>>::Output);
}