Skip to content

Commit 4b4f24f

Browse files
committed
fmt
1 parent ddda2cd commit 4b4f24f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/common/jsonb/src/functions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use super::value::Value;
3131
/// Build `JSONB` array from items.
3232
/// Assuming that the input values is valid JSONB data.
3333
pub fn build_array<'a>(
34-
items: impl IntoIterator<Item=&'a [u8]>,
34+
items: impl IntoIterator<Item = &'a [u8]>,
3535
buf: &mut Vec<u8>,
3636
) -> Result<(), Error> {
3737
let start = buf.len();
@@ -69,7 +69,7 @@ pub fn build_array<'a>(
6969
/// Build `JSONB` object from items.
7070
/// Assuming that the input values is valid JSONB data.
7171
pub fn build_object<'a, K: AsRef<str>>(
72-
items: impl IntoIterator<Item=(K, &'a [u8])>,
72+
items: impl IntoIterator<Item = (K, &'a [u8])>,
7373
buf: &mut Vec<u8>,
7474
) -> Result<(), Error> {
7575
let start = buf.len();
@@ -852,7 +852,7 @@ pub fn parse_json_path(path: &[u8]) -> Result<Vec<JsonPath>, Error> {
852852
break;
853853
}
854854
}
855-
let s = std::str::from_utf8(&path[prev_idx..idx-1])?;
855+
let s = std::str::from_utf8(&path[prev_idx..idx - 1])?;
856856
let json_path = JsonPath::String(Cow::Borrowed(s));
857857
json_paths.push(json_path);
858858
} else {

src/common/jsonb/tests/it/functions.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,8 @@ fn test_parse_json_path() {
361361
JsonPath::String(Cow::from("k2")),
362362
JsonPath::String(Cow::from("k3")),
363363
]),
364-
("\"k1\"", vec![JsonPath::String(Cow::from("k1")),
365-
]),
366-
("\"k1k2\"", vec![JsonPath::String(Cow::from("k1k2")),
367-
]),
364+
("\"k1\"", vec![JsonPath::String(Cow::from("k1"))]),
365+
("\"k1k2\"", vec![JsonPath::String(Cow::from("k1k2"))]),
368366
(r#"k1["k2"][1]"#, vec![
369367
JsonPath::String(Cow::from("k1")),
370368
JsonPath::String(Cow::from("k2")),
@@ -417,7 +415,7 @@ fn test_as_type() {
417415

418416
let mut buf: Vec<u8> = Vec::new();
419417
for (s, expect_null, expect_bool, expect_number, expect_str, expect_array, expect_object) in
420-
sources
418+
sources
421419
{
422420
let res = as_null(s.as_bytes());
423421
match expect_null {

0 commit comments

Comments
 (0)