pub fn slice<R>(&self, range: R) -> Self
    where
        R: RangeBounds<usize> + fmt::Debug + Clone,
    {
        fn bad_slice<R>(range: R) -> !
        where
            R: fmt::Debug,
        {
            panic!("Invalid range {:?} of span", range)
        }

        match self.try_slice(range.clone()) {
            Some(span) => span,
            None => bad_slice(range),
        }
    }
/// Slices this span to the given range.
///
/// # Panics
/// Panics if the range is invalid.
Slices this span to the given range.
Slices this span to the given range .
pub fn slice<R>(&self, range: R) -> Self
    where
        R: RangeBounds<usize> + fmt::Debug + Clone,
    {
        fn bad_slice<R>(range: R) -> !
        where
            R: fmt::Debug,
        {
            panic!("Invalid range {:?} of span", range)
        }
        match self.try_slice(range.clone()) {
            Some(span) => span,
            None => bad_slice(range),
        }
    }
pub fn slice < R > ( & self , range : R ) -> Self where R : RangeBounds < usize > + fmt :: Debug + Clone , { fn bad_slice < R > ( range : R ) -> ! where R : fmt :: Debug , { panic ! ( " " range ) } match self . try_slice ( range . clone ( ) ) { Some ( span ) => span , None => bad_slice ( range ) , } }
Slices this span to the given range.
Slices this span to the given range .
&self
range
R
&self
range
R
panics
Panics if the range is invalid.
Panics if the range is invalid .