| 1 | #![deny(missing_docs)] |
| 2 | #![allow(clippy::type_complexity)] |
| 3 | #![doc = include_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_str!!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))] |
| 4 | // Until we drop support for PyO3 0.22, allow use of deprecated functions. |
| 5 | #![allow(deprecated)] |
| 6 | |
| 7 | mod commonrust-analyzer cargo deb822-lossless 0.5.18 common/; |
| 8 | mod lexrust-analyzer cargo deb822-lossless 0.5.18 lex/; |
| 9 | mod losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/; |
| 10 | mod parserust-analyzer cargo deb822-lossless 0.5.18 parse/; |
| 11 | pub use lexrust-analyzer cargo deb822-lossless 0.5.18 lex/::SyntaxKindrust-analyzer cargo deb822-lossless 0.5.18 lex/SyntaxKind#; |
| 12 | pub use losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/::{ |
| 13 | Deb822rust-analyzer cargo deb822-lossless 0.5.18 lossless/Deb822#, Entryrust-analyzer cargo deb822-lossless 0.5.18 lossless/Entry#, Errorrust-analyzer cargo deb822-lossless 0.5.18 lossless/Error#, IndentPatternrust-analyzer cargo deb822-lossless 0.5.18 lossless/IndentPattern#, Langrust-analyzer cargo deb822-lossless 0.5.18 lossless/Lang#, Paragraphrust-analyzer cargo deb822-lossless 0.5.18 lossless/Paragraph#, ParseErrorrust-analyzer cargo deb822-lossless 0.5.18 lossless/ParseError#, PositionedParseErrorrust-analyzer cargo deb822-lossless 0.5.18 lossless/PositionedParseError#, |
| 14 | }; |
| 15 | pub use parserust-analyzer cargo deb822-lossless 0.5.18 parse/::Parserust-analyzer cargo deb822-lossless 0.5.18 parse/Parse#; |
| 16 | pub use rowanrust-analyzer cargo rowan 0.16.1 crate/::{TextRangerust-analyzer cargo text-size 1.1.1 range/TextRange#, TextSizerust-analyzer cargo text-size 1.1.1 size/TextSize#}; |
| 17 | |
| 18 | /// The indentation to use when writing a deb822 file. |
| 19 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 20 | pub enum Indentationrust-analyzer cargo deb822-lossless 0.5.18 Indentation# { |
| 21 | /// Use the same indentation as the original line for the value. |
| 22 | FieldNameLengthrust-analyzer cargo deb822-lossless 0.5.18 Indentation#FieldNameLength#, |
| 23 | |
| 24 | /// The number of spaces to use for indentation. |
| 25 | Spacesrust-analyzer cargo deb822-lossless 0.5.18 Indentation#Spaces#(u32), |
| 26 | } |
| 27 | |
| 28 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Indentationrust-analyzer cargo deb822-lossless 0.5.18 Indentation# { |
| 29 | fn defaultrust-analyzer cargo deb822-lossless 0.5.18 impl#[Indentation][Default]default().() -> Selfrust-analyzer cargo deb822-lossless 0.5.18 impl#[Indentation][Default] { |
| 30 | Indentationrust-analyzer cargo deb822-lossless 0.5.18 Indentation#::Spacesrust-analyzer cargo deb822-lossless 0.5.18 Indentation#Spaces#(4) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | #[cfg(feature = "deb822-fast")] |
| 35 | impl deb822_fastrust-analyzer cargo deb822-fast 0.2.3 crate/::convertrust-analyzer cargo deb822-fast 0.2.3 convert/::Deb822LikeParagraphrust-analyzer cargo deb822-fast 0.2.3 convert/Deb822LikeParagraph# for craterust-analyzer cargo deb822-lossless 0.5.18 crate/::losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/::Paragraphrust-analyzer cargo deb822-lossless 0.5.18 lossless/Paragraph# { |
| 36 | fn getrust-analyzer cargo deb822-lossless 0.5.18 impl#[Paragraph][Deb822LikeParagraph]get().(&self, key: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 37 | craterust-analyzer cargo deb822-lossless 0.5.18 crate/::losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/::Paragraphrust-analyzer cargo deb822-lossless 0.5.18 lossless/Paragraph#::getrust-analyzer cargo deb822-lossless 0.5.18 lossless/impl#[Paragraph]get().(self, key).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|v| v.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()) |
| 38 | } |
| 39 | |
| 40 | fn setrust-analyzer cargo deb822-lossless 0.5.18 impl#[Paragraph][Deb822LikeParagraph]set().(&mut self, key: &str, value: &str) { |
| 41 | craterust-analyzer cargo deb822-lossless 0.5.18 crate/::losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/::Paragraphrust-analyzer cargo deb822-lossless 0.5.18 lossless/Paragraph#::setrust-analyzer cargo deb822-lossless 0.5.18 lossless/impl#[Paragraph]set().(self, key, value); |
| 42 | } |
| 43 | |
| 44 | fn removerust-analyzer cargo deb822-lossless 0.5.18 impl#[Paragraph][Deb822LikeParagraph]remove().(&mut self, key: &str) { |
| 45 | craterust-analyzer cargo deb822-lossless 0.5.18 crate/::losslessrust-analyzer cargo deb822-lossless 0.5.18 lossless/::Paragraphrust-analyzer cargo deb822-lossless 0.5.18 lossless/Paragraph#::removerust-analyzer cargo deb822-lossless 0.5.18 lossless/impl#[Paragraph]remove().(self, key); |
| 46 | } |
| 47 | } |