Call cargo fmt
This commit is contained in:
parent
2701729dcf
commit
2823504e84
@ -12,13 +12,13 @@ custom_error! { pub IncorrectPointer{pointer: String} = "Incorrect pointer is sp
|
|||||||
/// This is a enum that used internally to refer to values inside of
|
/// This is a enum that used internally to refer to values inside of
|
||||||
/// JSON (their serde implementation) objects and arrays.
|
/// JSON (their serde implementation) objects and arrays.
|
||||||
/// This enum helps to simplify module's code.
|
/// This enum helps to simplify module's code.
|
||||||
///
|
///
|
||||||
/// For values inside of JSON object it stores object's
|
/// For values inside of JSON object it stores object's
|
||||||
/// `Map<String, serde_json::Value>` and name of referred value.
|
/// `Map<String, serde_json::Value>` and name of referred value.
|
||||||
///
|
///
|
||||||
/// For values inside JSON arrays it stores array's
|
/// For values inside JSON arrays it stores array's
|
||||||
/// `Vec<serde_json::Value>` and referred index.
|
/// `Vec<serde_json::Value>` and referred index.
|
||||||
///
|
///
|
||||||
/// `Invalid` can be used to return a failed state.
|
/// `Invalid` can be used to return a failed state.
|
||||||
enum ValueReference<'a> {
|
enum ValueReference<'a> {
|
||||||
Object(&'a mut serde_json::Map<String, serde_json::Value>, String),
|
Object(&'a mut serde_json::Map<String, serde_json::Value>, String),
|
||||||
@ -74,13 +74,13 @@ impl File {
|
|||||||
|
|
||||||
/// Inserts new JSON value inside this file
|
/// Inserts new JSON value inside this file
|
||||||
/// (possibly in some sub-object/array).
|
/// (possibly in some sub-object/array).
|
||||||
///
|
///
|
||||||
/// Given pointer must point at new value:
|
/// Given pointer must point at new value:
|
||||||
/// 1. If it already exists, - it will be overwritten.
|
/// 1. If it already exists, - it will be overwritten.
|
||||||
/// 2. If it does not exist, but it's parent object/array does -
|
/// 2. If it does not exist, but it's parent object/array does -
|
||||||
/// it will be added.
|
/// it will be added.
|
||||||
/// 3. Otherwise an error will be raise.
|
/// 3. Otherwise an error will be raise.
|
||||||
///
|
///
|
||||||
/// If array needs to be expanded, - missing values will be filled
|
/// If array needs to be expanded, - missing values will be filled
|
||||||
/// with `json!(null)`, i.e. inserting `7` at index `5` in array `[1, 2, 3]`
|
/// with `json!(null)`, i.e. inserting `7` at index `5` in array `[1, 2, 3]`
|
||||||
/// will produce `[1, 2, 3, null, null, 7]`.
|
/// will produce `[1, 2, 3, null, null, 7]`.
|
||||||
@ -120,7 +120,7 @@ impl File {
|
|||||||
|
|
||||||
/// Helper method to create a value if missing (as `json!(null)`).
|
/// Helper method to create a value if missing (as `json!(null)`).
|
||||||
/// Can only be done if parent container already exists.
|
/// Can only be done if parent container already exists.
|
||||||
///
|
///
|
||||||
/// For specifics refer to `insert()` method.
|
/// For specifics refer to `insert()` method.
|
||||||
fn touch(&mut self, pointer: &str) -> (Result<(), IncorrectPointer>) {
|
fn touch(&mut self, pointer: &str) -> (Result<(), IncorrectPointer>) {
|
||||||
// If value is present - we're done
|
// If value is present - we're done
|
||||||
|
Loading…
Reference in New Issue
Block a user