diff --git a/crates/toml_edit/src/parser/array.rs b/crates/toml_edit/src/parser/array.rs index 2c77843c..030d2bd1 100644 --- a/crates/toml_edit/src/parser/array.rs +++ b/crates/toml_edit/src/parser/array.rs @@ -1,11 +1,12 @@ -use crate::parser::trivia::ws_comment_newline; -use crate::parser::value::value; -use crate::{Array, Value}; use combine::parser::byte::byte; use combine::parser::range::recognize_with_value; use combine::stream::RangeStream; use combine::*; +use crate::parser::trivia::ws_comment_newline; +use crate::parser::value::value; +use crate::{Array, Value}; + // ;; Array // array = array-open array-values array-close diff --git a/crates/toml_edit/src/parser/document.rs b/crates/toml_edit/src/parser/document.rs index 2813d176..d528255c 100644 --- a/crates/toml_edit/src/parser/document.rs +++ b/crates/toml_edit/src/parser/document.rs @@ -1,3 +1,11 @@ +use std::cell::RefCell; + +use combine::parser::byte::byte; +use combine::stream::position::{IndexPositioner, Positioner, Stream}; +use combine::stream::RangeStream; +use combine::Parser; +use combine::*; + use crate::document::Document; use crate::key::Key; use crate::parser::inline_table::KEYVAL_SEP; @@ -8,12 +16,6 @@ use crate::parser::value::value; use crate::parser::{ParseState, TomlError}; use crate::table::TableKeyValue; use crate::Item; -use combine::parser::byte::byte; -use combine::stream::position::{IndexPositioner, Positioner, Stream}; -use combine::stream::RangeStream; -use combine::Parser; -use combine::*; -use std::cell::RefCell; // ;; TOML diff --git a/crates/toml_edit/src/parser/errors.rs b/crates/toml_edit/src/parser/errors.rs index d4abd460..a2ff053d 100644 --- a/crates/toml_edit/src/parser/errors.rs +++ b/crates/toml_edit/src/parser/errors.rs @@ -1,10 +1,12 @@ -use crate::Key; +use std::error::Error as StdError; +use std::fmt::{Display, Formatter, Result}; + use combine::easy::Errors as ParseError; use combine::stream::easy::Error; use combine::stream::position::SourcePosition; use itertools::Itertools; -use std::error::Error as StdError; -use std::fmt::{Display, Formatter, Result}; + +use crate::Key; /// Type representing a TOML parse error #[derive(Debug, Clone, Eq, PartialEq, Hash)] diff --git a/crates/toml_edit/src/parser/inline_table.rs b/crates/toml_edit/src/parser/inline_table.rs index e3924cca..438ca07e 100644 --- a/crates/toml_edit/src/parser/inline_table.rs +++ b/crates/toml_edit/src/parser/inline_table.rs @@ -1,3 +1,8 @@ +use combine::parser::byte::byte; +use combine::stream::RangeStream; +use combine::*; +use indexmap::map::Entry; + use crate::key::Key; use crate::parser::errors::CustomError; use crate::parser::key::key; @@ -5,10 +10,6 @@ use crate::parser::trivia::ws; use crate::parser::value::value; use crate::table::TableKeyValue; use crate::{InlineTable, InternalString, Item, Value}; -use combine::parser::byte::byte; -use combine::stream::RangeStream; -use combine::*; -use indexmap::map::Entry; // ;; Inline Table diff --git a/crates/toml_edit/src/parser/key.rs b/crates/toml_edit/src/parser/key.rs index c6ad7327..ad578ccd 100644 --- a/crates/toml_edit/src/parser/key.rs +++ b/crates/toml_edit/src/parser/key.rs @@ -1,12 +1,13 @@ +use combine::parser::byte::byte; +use combine::parser::range::{recognize_with_value, take_while1}; +use combine::stream::RangeStream; +use combine::*; + use crate::key::Key; use crate::parser::strings::{basic_string, literal_string}; use crate::parser::trivia::{from_utf8_unchecked, ws}; use crate::repr::{Decor, Repr}; use crate::InternalString; -use combine::parser::byte::byte; -use combine::parser::range::{recognize_with_value, take_while1}; -use combine::stream::RangeStream; -use combine::*; // key = simple-key / dotted-key // dotted-key = simple-key 1*( dot-sep simple-key ) diff --git a/crates/toml_edit/src/parser/numbers.rs b/crates/toml_edit/src/parser/numbers.rs index a99a82ff..a93abb01 100644 --- a/crates/toml_edit/src/parser/numbers.rs +++ b/crates/toml_edit/src/parser/numbers.rs @@ -1,9 +1,10 @@ -use crate::parser::trivia::from_utf8_unchecked; use combine::parser::byte::{byte, bytes, digit, hex_digit, oct_digit}; use combine::parser::range::{range, recognize}; use combine::stream::RangeStream; use combine::*; +use crate::parser::trivia::from_utf8_unchecked; + // ;; Boolean // boolean = true / false diff --git a/crates/toml_edit/src/parser/strings.rs b/crates/toml_edit/src/parser/strings.rs index dc50fafb..cfa69887 100644 --- a/crates/toml_edit/src/parser/strings.rs +++ b/crates/toml_edit/src/parser/strings.rs @@ -1,14 +1,16 @@ -use crate::parser::errors::CustomError; -use crate::parser::trivia::{ - from_utf8_unchecked, is_non_ascii, is_wschar, newline, ws, ws_newlines, -}; +use std::borrow::Cow; +use std::char; + use combine::error::Commit; use combine::parser::byte::{byte, bytes, hex_digit}; use combine::parser::range::{range, recognize, take_while, take_while1}; use combine::stream::RangeStream; use combine::*; -use std::borrow::Cow; -use std::char; + +use crate::parser::errors::CustomError; +use crate::parser::trivia::{ + from_utf8_unchecked, is_non_ascii, is_wschar, newline, ws, ws_newlines, +}; // ;; String diff --git a/crates/toml_edit/src/parser/table.rs b/crates/toml_edit/src/parser/table.rs index 5566f01b..d4807453 100644 --- a/crates/toml_edit/src/parser/table.rs +++ b/crates/toml_edit/src/parser/table.rs @@ -1,11 +1,13 @@ -use crate::parser::key::key; -use crate::parser::trivia::line_trailing; -use crate::parser::ParseState; +use std::cell::RefCell; + use combine::parser::byte::byte; use combine::parser::range::range; use combine::stream::RangeStream; use combine::*; -use std::cell::RefCell; + +use crate::parser::key::key; +use crate::parser::trivia::line_trailing; +use crate::parser::ParseState; // std-table-open = %x5B ws ; [ Left square bracket pub(crate) const STD_TABLE_OPEN: u8 = b'['; diff --git a/crates/toml_edit/src/parser/value.rs b/crates/toml_edit/src/parser/value.rs index 6fcbc75d..9dadbf5e 100644 --- a/crates/toml_edit/src/parser/value.rs +++ b/crates/toml_edit/src/parser/value.rs @@ -1,3 +1,7 @@ +use combine::parser::range::recognize_with_value; +use combine::stream::RangeStream; +use combine::*; + use crate::parser::array::array; use crate::parser::datetime::date_time; use crate::parser::inline_table::inline_table; @@ -7,9 +11,6 @@ use crate::parser::trivia::from_utf8_unchecked; use crate::repr::{Formatted, Repr}; use crate::value as v; use crate::Value; -use combine::parser::range::recognize_with_value; -use combine::stream::RangeStream; -use combine::*; // val = string / boolean / array / inline-table / date-time / float / integer parse!(value() -> v::Value, {