| 1 | #[cfg(feature = "serde")] |
| 2 | use serderust-analyzer cargo serde 1.0.219 crate/::{Deserializerust-analyzer cargo serde 1.0.219 de/Deserialize#, Serializerust-analyzer cargo serde 1.0.219 ser/Serialize#}; |
| 3 | |
| 4 | use superrust-analyzer cargo fluent-syntax 0.12.0 ast/::Commentrust-analyzer cargo fluent-syntax 0.12.0 ast/Comment#; |
| 5 | // This is a helper struct used to properly deserialize referential |
| 6 | // JSON comments which are single continuous String, into a vec of |
| 7 | // content slices. |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(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/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 9 | #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.219 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.219 Deserialize:))] |
| 10 | #[cfg_attr(feature = "serde", serde(untagged))] |
| 11 | pub enum CommentDefrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#<S> { |
| 12 | Singlerust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Single# { contentrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Single#content.: S }, |
| 13 | Multirust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Multi# { contentrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Multi#content.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<S> }, |
| 14 | } |
| 15 | |
| 16 | impl<S> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<CommentDefrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#<S>> for Commentrust-analyzer cargo fluent-syntax 0.12.0 ast/Comment#<S> { |
| 17 | fn fromrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/impl#[`Comment<S>`][`From<CommentDef<S>>`]from().(input: CommentDefrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#<S>) -> Selfrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/impl#[`Comment<S>`][`From<CommentDef<S>>`] { |
| 18 | match input { |
| 19 | CommentDefrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#::Singlerust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Single# { contentrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Single#content. } => Selfrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/impl#[`Comment<S>`][`From<CommentDef<S>>`] { |
| 20 | contentrust-analyzer cargo fluent-syntax 0.12.0 ast/Comment#content.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![content], |
| 21 | }, |
| 22 | CommentDefrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#::Multirust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Multi# { contentrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/CommentDef#Multi#content. } => Selfrust-analyzer cargo fluent-syntax 0.12.0 ast/helper/impl#[`Comment<S>`][`From<CommentDef<S>>`] { contentrust-analyzer cargo fluent-syntax 0.12.0 ast/Comment#content. }, |
| 23 | } |
| 24 | } |
| 25 | } |