Debian Codegraph @

src/parser/slice.rs

raw symbols SCIP
1 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/::Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#;
2
3 pub(craterust-analyzer cargo fluent-syntax 0.12.0 crate/) fn matches_fluent_wsrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/matches_fluent_ws().(c: char) -> bool {
4 c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().' ' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'\r' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'\n'
5 }
6
7 pub trait Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#<'s>: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str> + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# {
8 fn slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#slice().(&self, range: Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>) -> Self;
9 fn trimrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#trim().(&mut self);
10 }
11
12 impl Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#<'_> for Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
13 fn slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[String][`Slice<'_>`]slice().(&self, range: Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>) -> Selfrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[String][`Slice<'_>`] {
14 self[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().range]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()
15 }
16
17 fn trimrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[String][`Slice<'_>`]trim().(&mut self) {
18 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.trim_end_matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end_matches().(matches_fluent_wsrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/matches_fluent_ws().).to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().();
19 }
20 }
21
22 impl<'s> Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#<'s> for &'s str {
23 fn slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[`&'s str`][`Slice<'s>`]slice().(&self, range: Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>) -> Selfrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[`&'s str`][`Slice<'s>`] {
24 &self[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().range]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().
25 }
26
27 fn trimrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/impl#[`&'s str`][`Slice<'s>`]trim().(&mut self) {
28 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.trim_end_matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end_matches().(matches_fluent_wsrust-analyzer cargo fluent-syntax 0.12.0 parser/slice/matches_fluent_ws().);
29 }
30 }