Skip to content

Commit b39056f

Browse files
committed
Tidy up imports in the newly extracted modules
Signed-off-by: Nick Cameron <nrc@ncameron.org>
1 parent 8defd77 commit b39056f

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
22

3-
use serde_derive::*;
3+
use serde_derive::{Deserialize, Serialize};
44
use std::{path::PathBuf, time::Duration};
55

66
/// The configuration for either a [`raw::Client`](raw/struct.Client.html) or a

src/kv.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
use std::ops::{
44
Bound, Deref, DerefMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive,
55
};
6-
use std::u8::{MAX as U8_MAX, MIN as U8_MIN};
7-
use std::{fmt, str};
6+
use std::{fmt, str, u8};
87

98
use crate::{Error, Result};
109

@@ -400,7 +399,7 @@ fn range_to_keys(range: (Bound<Key>, Bound<Key>)) -> Result<(Key, Option<Key>)>
400399
Bound::Included(v) => v,
401400
Bound::Excluded(mut v) => {
402401
match v.last_mut() {
403-
None | Some(&mut U8_MAX) => v.push(0),
402+
None | Some(&mut u8::MAX) => v.push(0),
404403
Some(v) => *v += 1,
405404
}
406405
v
@@ -412,7 +411,7 @@ fn range_to_keys(range: (Bound<Key>, Bound<Key>)) -> Result<(Key, Option<Key>)>
412411
Bound::Excluded(mut v) => Some({
413412
match v.last_mut() {
414413
None => (),
415-
Some(&mut U8_MIN) => v.pop(),
414+
Some(&mut u8::MIN) => v.pop(),
416415
Some(v) => *v -= 1,
417416
}
418417
v
@@ -468,14 +467,10 @@ impl<T: Into<Key>> KeyRange for (Bound<T>, Bound<T>) {
468467
}
469468
}
470469

471-
fn convert_to_bound_key<K>(b: Bound<K>) -> Bound<Key>
472-
where
473-
K: Into<Key>,
474-
{
475-
use std::ops::Bound::*;
470+
fn convert_to_bound_key(b: Bound<impl Into<Key>>) -> Bound<Key> {
476471
match b {
477-
Included(k) => Included(k.into()),
478-
Excluded(k) => Excluded(k.into()),
479-
Unbounded => Unbounded,
472+
Bound::Included(k) => Bound::Included(k.into()),
473+
Bound::Excluded(k) => Bound::Excluded(k.into()),
474+
Bound::Unbounded => Bound::Unbounded,
480475
}
481476
}

0 commit comments

Comments
 (0)