Skip to content

Commit 030fc6a

Browse files
committed
style(err): format code
1 parent bcf4749 commit 030fc6a

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

taos-error/src/code/mod.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,22 @@ impl PartialEq<i32> for Code {
127127
}
128128
}
129129

130-
#[test]
131-
fn test_code() {
132-
let c: i32 = Code::new(0).into();
133-
assert_eq!(c, 0);
134-
let c = Code::from(0).to_string();
135-
assert_eq!(c, "0x0000");
136-
dbg!(Code::from(0x200));
137-
138-
let c: i8 = Code::new(0).into();
139-
let mut c: Code = c.into();
140-
141-
let _: &i32 = &c;
142-
let _: &mut i32 = &mut c;
130+
#[cfg(test)]
131+
mod tests {
132+
use super::Code;
133+
134+
#[test]
135+
fn test_code() {
136+
let c: i32 = Code::new(0).into();
137+
assert_eq!(c, 0);
138+
let c = Code::from(0).to_string();
139+
assert_eq!(c, "0x0000");
140+
dbg!(Code::from(0x200));
141+
142+
let c: i8 = Code::new(0).into();
143+
let mut c: Code = c.into();
144+
145+
let _: &i32 = &c;
146+
let _: &mut i32 = &mut c;
147+
}
143148
}

taos-error/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ mod source;
3838
/// ```
3939
///
4040
/// # Display representations
41-
#[derive(Error)]
4241
#[must_use]
42+
#[derive(Error)]
4343
pub struct Error {
4444
/// Error code, will be displayed when code is not 0xFFFF.
4545
code: Code,

taos-ws/src/consumer/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,7 @@ impl TmqBuilder {
10741074
.info
10751075
.build_stream_opt(self.info.to_tmq_url(), false)
10761076
.await?;
1077-
// let (ws, _) = taos_query::block_in_place_or_global(connect_async(url))?;
1078-
// let (ws, _) = connect_async(&url).await.map_err(WsTmqError::from)?;
1077+
10791078
let (mut sender, mut reader) = ws.split();
10801079

10811080
let version = WsSend::Version;

0 commit comments

Comments
 (0)