Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: normalize comments/doc in rustfmt #1335

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analytic_engine/src/compaction/picker.rs
Original file line number Diff line number Diff line change
@@ -257,7 +257,7 @@ impl Bucket {

#[inline]
fn hotness(f: &FileHandle) -> f64 {
//prevent NAN hotness
// prevent NAN hotness
let row_num = f.row_num().max(1);
f.read_meter().h2_rate() / (row_num as f64)
}
2 changes: 1 addition & 1 deletion analytic_engine/src/memtable/mod.rs
Original file line number Diff line number Diff line change
@@ -233,7 +233,7 @@ pub trait MemTable {

/// Insert one row into the memtable.
///
///.- ctx: The put context
/// .- ctx: The put context
/// - sequence: The sequence of the row
/// - row: The row to insert
/// - schema: The schema of the row
2 changes: 1 addition & 1 deletion analytic_engine/src/table_options.rs
Original file line number Diff line number Diff line change
@@ -249,7 +249,7 @@ pub enum StorageFormat {
/// Traditional columnar format, every column is saved in one exact one
/// column, for example:
///
///```plaintext
/// ```plaintext
/// | Timestamp | Device ID | Status Code | Tag 1 | Tag 2 |
/// | --------- |---------- | ----------- | ----- | ----- |
/// | 12:01 | A | 0 | v1 | v1 |
1 change: 0 additions & 1 deletion components/codec/src/varint.rs
Original file line number Diff line number Diff line change
@@ -56,7 +56,6 @@ pub fn encode_varint<B: SafeBufMut>(buf: &mut B, value: i64) -> Result<usize> {
encode_uvarint(buf, x)
}

//
// from https://golang.org/src/encoding/binary/varint.go?s=1611:1652#L31
//
// ```go
2 changes: 1 addition & 1 deletion components/notifier/src/notifier.rs
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ where
return RequestResult::Wait;
}

//the key is not existed, insert the key and the notifier.
// the key is not existed, insert the key and the notifier.
notifiers_by_key.insert(key, Notifiers::new(notifier));
RequestResult::First
}
4 changes: 2 additions & 2 deletions components/size_ext/src/lib.rs
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@

//! Configure utils
//This module is forked from tikv and remove unnecessary code.
//https://github.com/tikv/tikv/blob/HEAD/src/util/config.rs
// This module is forked from tikv and remove unnecessary code.
// https://github.com/tikv/tikv/blob/HEAD/src/util/config.rs
use std::{
fmt::{self, Write},
ops::{Div, Mul},
2 changes: 1 addition & 1 deletion interpreters/src/show_create.rs
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ impl ShowCreateInterpreter {
}

fn render_table_sql(table_ref: TableRef) -> String {
//TODO(boyan) pretty output
// TODO(boyan) pretty output
format!(
"CREATE TABLE `{}` ({}){} ENGINE={}{}",
table_ref.name(),
2 changes: 1 addition & 1 deletion meta_client/src/types.rs
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ pub struct NodeInfo {

/// The status changes of a shard as following:
///
///```plaintext
/// ```plaintext
/// ┌────┐
/// │Init│
/// └──┬─┘
4 changes: 2 additions & 2 deletions query_frontend/src/promql/convert.rs
Original file line number Diff line number Diff line change
@@ -85,11 +85,11 @@ impl TryFrom<OperandPb> for Expr {
query_range: TimeRange::new_unchecked(
Timestamp::new(start),
Timestamp::new(end + 1),
), /* [start, end] */
), // [start, end]
align_range: TimeRange::new_unchecked(
Timestamp::new(align_start),
Timestamp::new(align_end + 1),
), /* [align_start, align_end] */
), // [align_start, align_end]
step,
range,
offset,
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ reorder_impl_items = true
# Discard existing import groups, and create three groups for std, external crates, crates
group_imports = "StdExternalCrate"

normalize_comments = true
normalize_doc_attributes = true

ignore = [
"proto",
]