Skip to content

Commit

Permalink
rust: lightweight rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Jun 20, 2023
1 parent d334e4e commit b9390b6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
7 changes: 7 additions & 0 deletions qa/rustfmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ rust/src/quic/parser.rs
rust/src/quic/cyu.rs
rust/src/quic/crypto.rs
rust/src/common.rs
rust/src/sip/log.rs
rust/src/rdp/log.rs
rust/src/rfb/parser.rs
rust/src/http2/detect.rs
rust/src/ffi/base64.rs
rust/src/krb/detect.rs
rust/src/quic/frames.rs
2 changes: 1 addition & 1 deletion rust/src/ffi/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* 02110-1301, USA.
*/

use std::os::raw::c_uchar;
use libc::c_ulong;
use std::os::raw::c_uchar;

#[repr(C)]
#[allow(non_camel_case_types)]
Expand Down
2 changes: 1 addition & 1 deletion rust/src/http2/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ fn http2_tx_get_resp_line(tx: &mut HTTP2Transaction) {
return;
}
let empty = Vec::new();
let mut resp_line : Vec<u8> = Vec::new();
let mut resp_line: Vec<u8> = Vec::new();

let status =
if let Ok(value) = http2_frames_get_header_firstvalue(tx, Direction::ToClient, ":status") {
Expand Down
1 change: 0 additions & 1 deletion rust/src/krb/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ impl DetectKrb5TicketEncryptionList {
}
}


// Suppress large enum variant lint as the LIST is very large compared
// to the boolean variant.
#[derive(Debug)]
Expand Down
3 changes: 1 addition & 2 deletions rust/src/quic/frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ impl Frame {
let mut d = vec![0; crypto_max_size as usize];
for f in &frames {
if let Frame::CryptoFrag(c) = f {
d[c.offset as usize..(c.offset + c.length) as usize]
.clone_from_slice(&c.data);
d[c.offset as usize..(c.offset + c.length) as usize].clone_from_slice(&c.data);
}
}
if let Ok((_, msg)) = parse_tls_message_handshake(&d) {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/rdp/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::rdp::{RdpTransaction, RdpTransactionItem};
use crate::jsonbuilder::{JsonBuilder, JsonError};
use crate::rdp::parser::*;
use crate::rdp::windows;
use x509_parser::prelude::{X509Certificate, FromDer};
use x509_parser::prelude::{FromDer, X509Certificate};

#[no_mangle]
pub extern "C" fn rs_rdp_to_json(tx: &mut RdpTransaction, js: &mut JsonBuilder) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/rfb/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use nom7::*;
use std::fmt;
use std::str;

#[derive(Debug,PartialEq)]
#[derive(Debug, PartialEq)]
pub enum RFBGlobalState {
TCServerProtocolVersion,
TCSupportedSecurityTypes,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/sip/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ fn log(tx: &SIPTransaction, js: &mut JsonBuilder) -> Result<(), JsonError> {
#[no_mangle]
pub extern "C" fn rs_sip_log_json(tx: &mut SIPTransaction, js: &mut JsonBuilder) -> bool {
log(tx, js).is_ok()
}
}

0 comments on commit b9390b6

Please sign in to comment.