Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Anderson <andersrb@gmail.com>
  • Loading branch information
brson committed Oct 21, 2020
1 parent 625f5f2 commit dcc8be2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions components/engine_panic/src/cf_options.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

use crate::engine::PanicEngine;
use crate::db_options::PanicTitanDBOptions;
use engine_traits::{ColumnFamilyOptions, SstPartitionerFactory};
use crate::engine::PanicEngine;
use engine_traits::{CFOptionsExt, Result};
use engine_traits::{ColumnFamilyOptions, SstPartitionerFactory};

impl CFOptionsExt for PanicEngine {
type ColumnFamilyOptions = PanicColumnFamilyOptions;
Expand Down
8 changes: 5 additions & 3 deletions components/engine_rocks/src/cf_options.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

use crate::engine::RocksEngine;
use crate::util;
use crate::{db_options::RocksTitanDBOptions, sst_partitioner::RocksSstPartitionerFactory};
use engine_traits::{CFOptionsExt, Result};
use engine_traits::{ColumnFamilyOptions, SstPartitionerFactory};
use rocksdb::ColumnFamilyOptions as RawCFOptions;
use engine_traits::{CFOptionsExt, Result};
use crate::util;

impl CFOptionsExt for RocksEngine {
type ColumnFamilyOptions = RocksColumnFamilyOptions;

fn get_options_cf(&self, cf: &str) -> Result<Self::ColumnFamilyOptions> {
let handle = util::get_cf_handle(self.as_inner(), cf)?;
Ok(RocksColumnFamilyOptions::from_raw(self.as_inner().get_options_cf(handle)))
Ok(RocksColumnFamilyOptions::from_raw(
self.as_inner().get_options_cf(handle),
))
}

fn set_options_cf(&self, cf: &str, options: &[(&str, &str)]) -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion components/engine_rocks/src/import.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

use crate::engine::RocksEngine;
use crate::util;
use engine_traits::ImportExt;
use engine_traits::IngestExternalFileOptions;
use engine_traits::Result;
use rocksdb::set_external_sst_file_global_seq_no;
use rocksdb::IngestExternalFileOptions as RawIngestExternalFileOptions;
use std::fs::File;
use std::path::Path;
use crate::util;

impl ImportExt for RocksEngine {
type IngestExternalFileOptions = RocksIngestExternalFileOptions;
Expand Down
5 changes: 2 additions & 3 deletions components/engine_rocks/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use crate::import::RocksIngestExternalFileOptions;
use crate::sst::RocksSstWriterBuilder;
use crate::{util, RocksSstWriter};
use engine_traits::{
CFNamesExt, DeleteStrategy, ImportExt, IngestExternalFileOptions, IterOptions,
Iterable, Iterator, MiscExt, Mutable, Range, Result, SstWriter, SstWriterBuilder,
WriteBatchExt, ALL_CFS,
CFNamesExt, DeleteStrategy, ImportExt, IngestExternalFileOptions, IterOptions, Iterable,
Iterator, MiscExt, Mutable, Range, Result, SstWriter, SstWriterBuilder, WriteBatchExt, ALL_CFS,
};
use rocksdb::Range as RocksRange;
use tikv_util::keybuilder::KeyBuilder;
Expand Down
7 changes: 4 additions & 3 deletions components/engine_rocks/src/range_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use crate::engine::RocksEngine;
use crate::properties::{get_range_entries_and_versions, RangeProperties};
use engine_traits::{
MiscExt, Range, RangePropertiesExt, Result, TableProperties,
TablePropertiesCollection, TablePropertiesExt, CF_DEFAULT, CF_LOCK, CF_WRITE, LARGE_CFS,
MiscExt, Range, RangePropertiesExt, Result, TableProperties, TablePropertiesCollection,
TablePropertiesExt, CF_DEFAULT, CF_LOCK, CF_WRITE, LARGE_CFS,
};
use std::path::Path;

Expand All @@ -28,7 +28,8 @@ impl RangePropertiesExt for RocksEngine {

let start = &range.start_key;
let end = &range.end_key;
let (_, keys) = get_range_entries_and_versions(self, CF_WRITE, &start, &end).unwrap_or_default();
let (_, keys) =
get_range_entries_and_versions(self, CF_WRITE, &start, &end).unwrap_or_default();
Ok(keys)
}

Expand Down
2 changes: 1 addition & 1 deletion components/engine_traits/src/cf_options.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

use crate::{db_options::TitanDBOptions, sst_partitioner::SstPartitionerFactory};
use crate::Result;
use crate::{db_options::TitanDBOptions, sst_partitioner::SstPartitionerFactory};

/// Trait for engines with column family options
pub trait CFOptionsExt {
Expand Down
4 changes: 1 addition & 3 deletions src/server/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,9 +1732,7 @@ mod tests {

let remove_region_state = |region_id: u64| {
let key = keys::region_state_key(region_id);
engine
.delete_cf(CF_RAFT, &key)
.unwrap();
engine.delete_cf(CF_RAFT, &key).unwrap();
};

let mut region = Region::default();
Expand Down

0 comments on commit dcc8be2

Please sign in to comment.