| 1 | use craterust-analyzer cargo dissimilar 1.0.2 crate/::findrust-analyzer cargo dissimilar 1.0.2 find/::findrust-analyzer cargo dissimilar 1.0.2 find/find().; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{selfrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/, RangeFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#, RangeFullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#, RangeTorust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#}; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::{CharIndicesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/CharIndices#, Charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/Chars#}; |
| 5 | |
| 6 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 7 | pub struct Rangerust-analyzer cargo dissimilar 1.0.2 range/Range#<'a> { |
| 8 | pub docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc.: &'a str, |
| 9 | pub offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset.: usize, |
| 10 | pub lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.: usize, |
| 11 | } |
| 12 | |
| 13 | impl<'a> Rangerust-analyzer cargo dissimilar 1.0.2 range/Range#<'a> { |
| 14 | pub fn emptyrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]empty().() -> Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`] { |
| 15 | Rangerust-analyzer cargo dissimilar 1.0.2 range/Range# { |
| 16 | docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc.: "", |
| 17 | offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset.: 0, |
| 18 | lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.: 0, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | pub fn newrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]new().(doc: &'a str, bounds: impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#) -> Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`] { |
| 23 | let (offset, len) = bounds.indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#index().(doc.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()); |
| 24 | Rangerust-analyzer cargo dissimilar 1.0.2 range/Range# { docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc., offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset., lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len. } |
| 25 | } |
| 26 | |
| 27 | pub fn is_emptyrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]is_empty().(&self) -> bool { |
| 28 | self.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 |
| 29 | } |
| 30 | |
| 31 | pub fn substringrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]substring().(&self, bounds: impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#) -> Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`] { |
| 32 | let (offset, len) = bounds.indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#index().(self.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.); |
| 33 | Rangerust-analyzer cargo dissimilar 1.0.2 range/Range# { |
| 34 | docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc.: self.docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc., |
| 35 | offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset.: self.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset, |
| 36 | lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len., |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | pub fn getrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]get().(&self, bounds: impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]> { |
| 41 | let (offset, len) = bounds.try_indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#try_index().(self.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch().; |
| 42 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Rangerust-analyzer cargo dissimilar 1.0.2 range/Range# { |
| 43 | docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc.: self.docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc., |
| 44 | offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset.: self.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset, |
| 45 | lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len., |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | pub fn split_atrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]split_at().(&self, mid: usize) -> (Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`], Selfrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]) { |
| 50 | (self.substringrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]substring().(..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#mid), self.substringrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]substring().(mid..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#)) |
| 51 | } |
| 52 | |
| 53 | pub fn charsrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]chars().(&self) -> Charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/Chars#<'a> { |
| 54 | strrust-analyzer cargo dissimilar 1.0.2 range/str().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().() |
| 55 | } |
| 56 | |
| 57 | pub fn char_indicesrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]char_indices().(&self) -> CharIndicesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/CharIndices#<'a> { |
| 58 | strrust-analyzer cargo dissimilar 1.0.2 range/str().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).char_indicesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]char_indices().() |
| 59 | } |
| 60 | |
| 61 | pub fn bytesrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]bytes().(&self) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = u8> + DoubleEndedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/double_ended/DoubleEndedIterator# + ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator# + 'a { |
| 62 | bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().clonedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#cloned().() |
| 63 | } |
| 64 | |
| 65 | pub fn starts_withrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]starts_with().(&self, prefix: impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[u8]>) -> bool { |
| 66 | bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]starts_with().(prefix.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().()) |
| 67 | } |
| 68 | |
| 69 | pub fn ends_withrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]ends_with().(&self, suffix: impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[u8]>) -> bool { |
| 70 | bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]ends_with().(suffix.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().()) |
| 71 | } |
| 72 | |
| 73 | pub fn findrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'a>`]find().(&self, needle: impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[u8]>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize> { |
| 74 | findrust-analyzer cargo dissimilar 1.0.2 find/find().(bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self), needle.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().()) |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | pub fn strrust-analyzer cargo dissimilar 1.0.2 range/str().(range: Rangerust-analyzer cargo dissimilar 1.0.2 range/Range#) -> &str { |
| 79 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(debug) |
| 80 | && range |
| 81 | .docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc. |
| 82 | .getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]get().(range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().range.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.) |
| 83 | .is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() |
| 84 | { |
| 85 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!( |
| 86 | "doc={:?} offset={} len={}", |
| 87 | range.docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc., range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset., range.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len. |
| 88 | ); |
| 89 | } |
| 90 | &range.docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().range.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 91 | } |
| 92 | |
| 93 | pub fn bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(range: Rangerust-analyzer cargo dissimilar 1.0.2 range/Range#) -> &[u8] { |
| 94 | &range.docrust-analyzer cargo dissimilar 1.0.2 range/Range#doc..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#range.offsetrust-analyzer cargo dissimilar 1.0.2 range/Range#offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().range.lenrust-analyzer cargo dissimilar 1.0.2 range/Range#len.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 95 | } |
| 96 | |
| 97 | impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[u8]> for Rangerust-analyzer cargo dissimilar 1.0.2 range/Range#<'_> { |
| 98 | fn as_refrust-analyzer cargo dissimilar 1.0.2 range/impl#[`Range<'_>`][`AsRef<[u8]>`]as_ref().(&self) -> &[u8] { |
| 99 | bytesrust-analyzer cargo dissimilar 1.0.2 range/bytes().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | pub trait RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# { |
| 104 | // Returns (offset, len). |
| 105 | fn try_indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#try_index().(self, len: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<(usize, usize)>; |
| 106 | fn indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#index().(self, len: usize) -> (usize, usize) { |
| 107 | match self.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().().try_indexrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds#try_index().(len) { |
| 108 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(range) => range, |
| 109 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of range, index={:?}, len={}", self, len), |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds# for opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize> { |
| 115 | fn try_indexrust-analyzer cargo dissimilar 1.0.2 range/impl#[`ops::Range<usize>`][RangeBounds]try_index().(self, len: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<(usize, usize)> { |
| 116 | if self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#start. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#end. && self.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().len { |
| 117 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#start., self.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#start.)) |
| 118 | } else { |
| 119 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds# for RangeFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#<usize> { |
| 125 | fn try_indexrust-analyzer cargo dissimilar 1.0.2 range/impl#[`RangeFrom<usize>`][RangeBounds]try_index().(self, len: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<(usize, usize)> { |
| 126 | if self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#start. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().len { |
| 127 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#start., len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().self.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#start.)) |
| 128 | } else { |
| 129 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds# for RangeTorust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#<usize> { |
| 135 | fn try_indexrust-analyzer cargo dissimilar 1.0.2 range/impl#[`RangeTo<usize>`][RangeBounds]try_index().(self, len: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<(usize, usize)> { |
| 136 | if self.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().len { |
| 137 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((0, self.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#end.)) |
| 138 | } else { |
| 139 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | impl RangeBoundsrust-analyzer cargo dissimilar 1.0.2 range/RangeBounds# for RangeFullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull# { |
| 145 | fn try_indexrust-analyzer cargo dissimilar 1.0.2 range/impl#[RangeFull][RangeBounds]try_index().(self, len: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<(usize, usize)> { |
| 146 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((0, len)) |
| 147 | } |
| 148 | } |