Skip to content

Commit ea10bc1

Browse files
committed
style(*): format code
1 parent 9ccb44d commit ea10bc1

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

taos-query/src/common/raw/mod.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,29 @@ use std::ptr::NonNull;
1111
use std::rc::Rc;
1212

1313
use bytes::Bytes;
14+
pub use data::*;
15+
use derive_builder::Builder;
1416
use itertools::Itertools;
17+
use layout::Layout;
18+
pub use meta::*;
1519
use rayon::prelude::*;
20+
pub use rows::*;
1621
use serde::Deserialize;
1722
use taos_error::Error;
23+
pub use views::ColumnView;
24+
use views::*;
1825

1926
use crate::common::{BorrowedValue, Field, Precision, Ty, Value};
2027

2128
pub mod layout;
2229
pub mod meta;
23-
24-
mod data;
25-
26-
use layout::Layout;
27-
2830
#[allow(clippy::missing_safety_doc)]
2931
#[allow(clippy::should_implement_trait)]
3032
pub mod views;
3133

32-
pub use data::*;
33-
pub use meta::*;
34-
pub use views::ColumnView;
35-
use views::*;
36-
34+
mod data;
3735
mod de;
3836
mod rows;
39-
use derive_builder::Builder;
40-
pub use rows::*;
4137

4238
#[derive(Debug, Clone, Copy)]
4339
#[repr(C, packed(1))]
@@ -79,6 +75,7 @@ impl Header {
7975
fn nrows(&self) -> usize {
8076
self.nrows as _
8177
}
78+
8279
fn ncols(&self) -> usize {
8380
self.ncols as _
8481
}

taos-ws-sys/src/ws/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ impl<T> Drop for WsMaybeError<T> {
152152
fn drop(&mut self) {
153153
if !self.data.is_null() {
154154
tracing::trace!("dropping obj {}", self.type_id);
155-
// let _ = unsafe { self.data.read() };
156155
let _ = unsafe { Box::from_raw(self.data) };
157156
}
158157
}
@@ -348,6 +347,7 @@ impl WS_FIELD_V2 {
348347
pub fn name(&self) -> &CStr {
349348
unsafe { CStr::from_ptr(self.name.as_ptr() as _) }
350349
}
350+
351351
pub fn r#type(&self) -> Ty {
352352
self.r#type.into()
353353
}
@@ -386,6 +386,7 @@ impl WS_FIELD {
386386
pub fn name(&self) -> &CStr {
387387
unsafe { CStr::from_ptr(self.name.as_ptr() as _) }
388388
}
389+
389390
pub fn r#type(&self) -> Ty {
390391
self.r#type.into()
391392
}
@@ -569,13 +570,15 @@ impl WsResultSetTrait for WsResultSet {
569570
WsResultSet::Schemaless(rs) => rs.tmq_get_topic_name(),
570571
}
571572
}
573+
572574
fn tmq_get_db_name(&self) -> *const c_char {
573575
match self {
574576
WsResultSet::Sql(rs) => rs.tmq_get_db_name(),
575577
WsResultSet::Tmq(rs) => rs.tmq_get_db_name(),
576578
WsResultSet::Schemaless(rs) => rs.tmq_get_db_name(),
577579
}
578580
}
581+
579582
fn tmq_get_table_name(&self) -> *const c_char {
580583
match self {
581584
WsResultSet::Sql(rs) => rs.tmq_get_table_name(),
@@ -599,6 +602,7 @@ impl WsResultSetTrait for WsResultSet {
599602
WsResultSet::Schemaless(rs) => rs.tmq_get_vgroup_offset(),
600603
}
601604
}
605+
602606
fn tmq_get_vgroup_id(&self) -> i32 {
603607
match self {
604608
WsResultSet::Sql(rs) => rs.tmq_get_vgroup_id(),
@@ -646,6 +650,7 @@ impl WsResultSetTrait for WsResultSet {
646650
WsResultSet::Schemaless(rs) => rs.get_fields(),
647651
}
648652
}
653+
649654
fn get_fields_v2(&mut self) -> *const WS_FIELD_V2 {
650655
match self {
651656
WsResultSet::Sql(rs) => rs.get_fields_v2(),
@@ -989,9 +994,9 @@ unsafe fn query_with_sql(
989994
) -> WsResult<WsResultSet> {
990995
let client = (taos as *mut Taos)
991996
.as_mut()
992-
.ok_or(WsError::new(Code::INVALID_PARA, "client pointer it null"))?;
997+
.ok_or(WsError::new(Code::INVALID_PARA, "client pointer is null"))?;
993998

994-
let sql = CStr::from_ptr(sql as _).to_str()?;
999+
let sql = CStr::from_ptr(sql).to_str()?;
9951000
let rs = client.query_with_req_id(sql, req_id)?;
9961001
Ok(WsResultSet::Sql(WsSqlResultSet::new(rs)))
9971002
}
@@ -1141,7 +1146,7 @@ pub unsafe extern "C" fn ws_select_db(taos: *mut WS_TAOS, db: *const c_char) ->
11411146
}
11421147
};
11431148

1144-
let db = CStr::from_ptr(db as _).to_str();
1149+
let db = CStr::from_ptr(db).to_str();
11451150
let db = match db {
11461151
Ok(t) => t,
11471152
Err(_) => {

0 commit comments

Comments
 (0)