Skip to content

Commit

Permalink
walks back taplo style
Browse files Browse the repository at this point in the history
  • Loading branch information
chanced committed Jun 24, 2024
1 parent 2d1fcf3 commit 5f8f3de
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 60 deletions.
42 changes: 21 additions & 21 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
include = ["**/*.toml", "**/Cargo.toml", "Cargo.toml"]
[formatting]
align_comments = true
align_entries = true
allowed_blank_lines = 1
indent_entries = true
indent_tables = true
reorder_arrays = false
reorder_keys = true
trailing_newline = true
align_comments = true
align_entries = true
allowed_blank_lines = 1
# indent_entries = true
# indent_tables = true
reorder_arrays = false
reorder_keys = true
trailing_newline = true

[[rule]]
formatting.align_entries = true
formatting.array_auto_expand = false
formatting.reorder_arrays = true
formatting.reorder_keys = true
include = ["Cargo.toml", "**/Cargo.toml"]
keys = [
"dependencies",
"dev-dependencies",
"build-dependencies",
"workspace.dependencies",
"workspace.dev-dependencies",
"workspace.build-dependencies",
]
formatting.align_entries = true
formatting.array_auto_expand = false
formatting.reorder_arrays = true
formatting.reorder_keys = true
include = ["Cargo.toml", "**/Cargo.toml"]
keys = [
"dependencies",
"dev-dependencies",
"build-dependencies",
"workspace.dependencies",
"workspace.dev-dependencies",
"workspace.build-dependencies",
]
58 changes: 29 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
[package]
authors = ["chance dinkins", "André Sá de Mello <codasm@pm.me>"]
description = "Data structures and logic for resolving, assigning, and deleting by JSON Pointers (RFC 6901)"
documentation = "https://docs.rs/jsonptr"
edition = "2021"
homepage = "https://github.com/chanced/jsonptr"
keywords = ["json-pointer", "rfc-6901", "6901"]
license = "MIT OR Apache-2.0"
name = "jsonptr"
repository = "https://github.com/chanced/jsonptr"
version = "0.4.7"
authors = ["chance dinkins", "André Sá de Mello <codasm@pm.me>"]
description = "Data structures and logic for resolving, assigning, and deleting by JSON Pointers (RFC 6901)"
documentation = "https://docs.rs/jsonptr"
edition = "2021"
homepage = "https://github.com/chanced/jsonptr"
keywords = ["json-pointer", "rfc-6901", "6901"]
license = "MIT OR Apache-2.0"
name = "jsonptr"
repository = "https://github.com/chanced/jsonptr"
version = "0.4.7"

[dependencies.serde]
default-features = false
features = ["alloc"]
version = "1.0"
default-features = false
features = ["alloc"]
version = "1.0"

[dependencies.serde_json]
default-features = false
features = ["alloc"]
optional = true
version = "1.0"
default-features = false
features = ["alloc"]
optional = true
version = "1.0"

[dependencies.toml]
optional = true
version = "0.8"
optional = true
version = "0.8"

[dev-dependencies]
insta = "1.39.0"
quickcheck = "1.0.3"
quickcheck_macros = "1.0.0"
insta = "1.39.0"
quickcheck = "1.0.3"
quickcheck_macros = "1.0.0"

[features]
assign = []
default = ["std", "json"]
delete = []
json = ["dep:serde_json"]
ops = ["resolve", "assign", "delete"]
resolve = []
std = ["serde/std", "serde_json?/std"]
assign = []
default = ["std", "json"]
delete = []
json = ["dep:serde_json"]
ops = ["resolve", "assign", "delete"]
resolve = []
std = ["serde/std", "serde_json?/std"]
4 changes: 1 addition & 3 deletions src/assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ enum Assigned<'v, V> {
Continue { next_dest: &'v mut V, same_value: V },
}

#[cfg(feature = "json")]
#[cfg(feature = "serde_json")]
mod json {
use super::*;
use crate::{Pointer, Token};
Expand Down Expand Up @@ -322,8 +322,6 @@ mod json {

use crate::{Pointer, PointerBuf};

use super::*;

#[test]
fn test_assign() {
let mut data = json!({});
Expand Down
11 changes: 10 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ extern crate alloc;

use core::{fmt, num::ParseIntError};

pub mod prelude;

#[cfg(feature = "assign")]
pub mod assign;

#[cfg(feature = "delete")]
pub mod delete;
pub mod prelude;

#[cfg(feature = "resolve")]
pub mod resolve;

mod tokens;
pub use tokens::*;

mod pointer;
pub use pointer::*;

mod token;
pub use token::*;

pub mod index;
pub use index::Index;

Expand Down
15 changes: 9 additions & 6 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Exposes the traits `Assign`, `Delete`, `Resolve`, `ResolveMut`
pub use crate::{
assign::Assign,
delete::Delete,
resolve::{Resolve, ResolveMut},
};
//! Exposes the traits `Assign`, `Delete`, `Resolve`, `ResolveMut` if enabled.
#[cfg(feature = "assign")]
pub use crate::assign::Assign;

#[cfg(feature = "resolve")]
pub use resolve::{Resolve, ResolveMut};

#[cfg(feature = "delete")]
pub use crate::delete::Delete;

0 comments on commit 5f8f3de

Please sign in to comment.