Skip to content

Commit

Permalink
re-format
Browse files Browse the repository at this point in the history
  • Loading branch information
wlqm committed Sep 26, 2024
1 parent 676aed5 commit 9508a7f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 34 deletions.
1 change: 0 additions & 1 deletion core/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
max_width = 89
version = "Two"
comment_width = 89
error_on_line_overflow = false
11 changes: 5 additions & 6 deletions core/src/common/engines/parity_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,11 @@ impl Engine for ParityEngine {
let x = LK.lock();

// step 1
let ret = crate::parse_prefix!(
self.hdr
.get(META_COLID, &self.prefix_allocator.key)
.unwrap()
.unwrap()
);
let ret = crate::parse_prefix!(self
.hdr
.get(META_COLID, &self.prefix_allocator.key)
.unwrap()
.unwrap());

// step 2
self.hdr
Expand Down
8 changes: 5 additions & 3 deletions core/src/common/engines/rocks_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ impl Engine for RocksEngine {
let x = LK.lock();

// step 1
let ret = crate::parse_prefix!(
self.meta.get(self.prefix_allocator.key).unwrap().unwrap()
);
let ret = crate::parse_prefix!(self
.meta
.get(self.prefix_allocator.key)
.unwrap()
.unwrap());

// step 2
self.meta
Expand Down
10 changes: 4 additions & 6 deletions core/tests/basic_mapx_raw_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ fn basic_cases() {
reloaded.insert(&[6], &[6]);
reloaded.insert(&[80], &[80]);

assert!(
reloaded
.range(Cow::Borrowed(&[][..])..Cow::Borrowed(&[1][..]))
.next()
.is_none()
);
assert!(reloaded
.range(Cow::Borrowed(&[][..])..Cow::Borrowed(&[1][..]))
.next()
.is_none());
assert_eq!(
vec![4],
reloaded
Expand Down
1 change: 0 additions & 1 deletion utils/slot_db/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
max_width = 79
version = "Two"
comment_width = 79
# error_on_line_overflow = false
1 change: 0 additions & 1 deletion wrappers/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
max_width = 89
version = "Two"
comment_width = 89
error_on_line_overflow = false
4 changes: 1 addition & 3 deletions wrappers/src/common/ende.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,7 @@ macro_rules! impl_all {
};
}

impl_all!(
i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize
);
impl_all!(i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize);
impl_all!(
@i8, @i16, @i32, @i64, @i128, @isize, @u16, @u32, @u64, @u128, @usize
);
Expand Down
4 changes: 3 additions & 1 deletion wrappers/src/dagmap/rawkey/test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use super::*;

macro_rules! s {
($i: expr) => {{ $i.as_bytes().to_vec() }};
($i: expr) => {{
$i.as_bytes().to_vec()
}};
}

#[test]
Expand Down
10 changes: 4 additions & 6 deletions wrappers/tests/basic_mapx_ord_rawvalue_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ fn basic_cases() {
&100usize.to_be_bytes()[..],
&reloaded.range(&100..=&999).next().unwrap().1[..]
);
assert!(
reloaded
.range((Bound::Excluded(&100), Bound::Included(&999)))
.next()
.is_none()
);
assert!(reloaded
.range((Bound::Excluded(&100), Bound::Included(&999)))
.next()
.is_none());

assert_eq!(
&100usize.to_be_bytes()[..],
Expand Down
10 changes: 4 additions & 6 deletions wrappers/tests/basic_mapx_ord_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ fn basic_cases() {
assert_eq!(100, reloaded.range(12..=999).next().unwrap().1.idx);

assert_eq!(100, reloaded.range(100..=999).next().unwrap().1.idx);
assert!(
reloaded
.range((Bound::Excluded(100), Bound::Included(999)))
.next()
.is_none()
);
assert!(reloaded
.range((Bound::Excluded(100), Bound::Included(999)))
.next()
.is_none());

assert_eq!(100, reloaded.get_ge(&99).unwrap().1.idx);
assert_eq!(100, reloaded.get_ge(&100).unwrap().1.idx);
Expand Down

0 comments on commit 9508a7f

Please sign in to comment.