| 1 | use synrust-analyzer cargo syn 2.0.119 crate/::{ |
| 2 | parserust-analyzer cargo syn 2.0.119 parse/::{Parserust-analyzer cargo syn 2.0.119 parse/Parse#, ParseStreamrust-analyzer cargo syn 2.0.119 parse/ParseStream#}, |
| 3 | punctuatedrust-analyzer cargo syn 2.0.119 punctuated/::Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#, |
| 4 | Metarust-analyzer cargo syn 2.0.119 attr/Meta#, Tokenrust-analyzer cargo syn 2.0.119 token/Token!, Typerust-analyzer cargo syn 2.0.119 ty/Type#, |
| 5 | }; |
| 6 | |
| 7 | pub(craterust-analyzer cargo educe 0.6.0 crate/) struct TypeWithPunctuatedMetarust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta# { |
| 8 | pub(craterust-analyzer cargo educe 0.6.0 crate/) tyrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#ty.: Typerust-analyzer cargo syn 2.0.119 ty/Type#, |
| 9 | pub(craterust-analyzer cargo educe 0.6.0 crate/) listrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#list.: Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#<Metarust-analyzer cargo syn 2.0.119 attr/Meta#, Tokenrust-analyzer cargo syn 2.0.119 token/Token!![,]>, |
| 10 | } |
| 11 | |
| 12 | impl Parserust-analyzer cargo syn 2.0.119 parse/Parse# for TypeWithPunctuatedMetarust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta# { |
| 13 | #[inline] |
| 14 | fn parserust-analyzer cargo educe 0.6.0 common/`r#type`/impl#[TypeWithPunctuatedMeta][Parse]parse().(input: ParseStreamrust-analyzer cargo syn 2.0.119 parse/ParseStream#) -> synrust-analyzer cargo syn 2.0.119 crate/::Resultrust-analyzer cargo syn 2.0.119 error/Result#<Selfrust-analyzer cargo educe 0.6.0 common/`r#type`/impl#[TypeWithPunctuatedMeta][Parse]> { |
| 15 | let ty = input.parserust-analyzer cargo syn 2.0.119 parse/impl#[`ParseBuffer<'a>`]parse().::<Typerust-analyzer cargo syn 2.0.119 ty/Type#>()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 16 | |
| 17 | if input.is_emptyrust-analyzer cargo syn 2.0.119 parse/impl#[`ParseBuffer<'a>`]is_empty().() { |
| 18 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo educe 0.6.0 common/`r#type`/impl#[TypeWithPunctuatedMeta][Parse] { |
| 19 | tyrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#ty., |
| 20 | listrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#list.: Punctuatedrust-analyzer cargo syn 2.0.119 punctuated/Punctuated#::newrust-analyzer cargo syn 2.0.119 punctuated/impl#[`Punctuated<T, P>`]new().(), |
| 21 | }); |
| 22 | } |
| 23 | |
| 24 | input.parserust-analyzer cargo syn 2.0.119 parse/impl#[`ParseBuffer<'a>`]parse().::<Tokenrust-analyzer cargo syn 2.0.119 token/Token!![,]>()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 25 | |
| 26 | let list = input.parse_terminatedrust-analyzer cargo syn 2.0.119 parse/impl#[`ParseBuffer<'a>`]parse_terminated().(Metarust-analyzer cargo syn 2.0.119 attr/Meta#::parserust-analyzer cargo syn 2.0.119 attr/parsing/impl#[Meta][Parse]parse()., Tokenrust-analyzer cargo syn 2.0.119 token/Token!![,])?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 27 | |
| 28 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo educe 0.6.0 common/`r#type`/impl#[TypeWithPunctuatedMeta][Parse] { |
| 29 | tyrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#ty., |
| 30 | listrust-analyzer cargo educe 0.6.0 common/`r#type`/TypeWithPunctuatedMeta#list., |
| 31 | }) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | #[inline] |
| 36 | pub(craterust-analyzer cargo educe 0.6.0 crate/) fn dereferencerust-analyzer cargo educe 0.6.0 common/`r#type`/dereference().(ty: &Typerust-analyzer cargo syn 2.0.119 ty/Type#) -> &Typerust-analyzer cargo syn 2.0.119 ty/Type# { |
| 37 | if let Typerust-analyzer cargo syn 2.0.119 ty/Type#::Referencerust-analyzer cargo syn 2.0.119 ty/Type#Reference#(ty) = ty { |
| 38 | dereferencerust-analyzer cargo educe 0.6.0 common/`r#type`/dereference().(ty.elemrust-analyzer cargo syn 2.0.119 ty/TypeReference#elem..as_refrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][`AsRef<T>`]as_ref().()) |
| 39 | } else { |
| 40 | ty |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | #[inline] |
| 45 | pub(craterust-analyzer cargo educe 0.6.0 crate/) fn dereference_changedrust-analyzer cargo educe 0.6.0 common/`r#type`/dereference_changed().(ty: &Typerust-analyzer cargo syn 2.0.119 ty/Type#) -> (&Typerust-analyzer cargo syn 2.0.119 ty/Type#, bool) { |
| 46 | if let Typerust-analyzer cargo syn 2.0.119 ty/Type#::Referencerust-analyzer cargo syn 2.0.119 ty/Type#Reference#(ty) = ty { |
| 47 | (dereferencerust-analyzer cargo educe 0.6.0 common/`r#type`/dereference().(ty.elemrust-analyzer cargo syn 2.0.119 ty/TypeReference#elem..as_refrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][`AsRef<T>`]as_ref().()), true) |
| 48 | } else { |
| 49 | (ty, false) |
| 50 | } |
| 51 | } |