Skip to content

Commit

Permalink
style(err): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
qevolg committed Dec 26, 2024
1 parent bcf4749 commit 030fc6a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
31 changes: 18 additions & 13 deletions taos-error/src/code/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,22 @@ impl PartialEq<i32> for Code {
}
}

#[test]
fn test_code() {
let c: i32 = Code::new(0).into();
assert_eq!(c, 0);
let c = Code::from(0).to_string();
assert_eq!(c, "0x0000");
dbg!(Code::from(0x200));

let c: i8 = Code::new(0).into();
let mut c: Code = c.into();

let _: &i32 = &c;
let _: &mut i32 = &mut c;
#[cfg(test)]
mod tests {
use super::Code;

#[test]
fn test_code() {
let c: i32 = Code::new(0).into();
assert_eq!(c, 0);
let c = Code::from(0).to_string();
assert_eq!(c, "0x0000");
dbg!(Code::from(0x200));

let c: i8 = Code::new(0).into();
let mut c: Code = c.into();

let _: &i32 = &c;
let _: &mut i32 = &mut c;
}
}
2 changes: 1 addition & 1 deletion taos-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ mod source;
/// ```
///
/// # Display representations
#[derive(Error)]
#[must_use]
#[derive(Error)]
pub struct Error {
/// Error code, will be displayed when code is not 0xFFFF.
code: Code,
Expand Down
3 changes: 1 addition & 2 deletions taos-ws/src/consumer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,7 @@ impl TmqBuilder {
.info
.build_stream_opt(self.info.to_tmq_url(), false)
.await?;
// let (ws, _) = taos_query::block_in_place_or_global(connect_async(url))?;
// let (ws, _) = connect_async(&url).await.map_err(WsTmqError::from)?;

let (mut sender, mut reader) = ws.split();

let version = WsSend::Version;
Expand Down

0 comments on commit 030fc6a

Please sign in to comment.