]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: remove unnecessary parentheses (Rust 1.40 fixup) 4512/head
authorJason Ish <jason.ish@oisf.net>
Thu, 19 Dec 2019 17:02:56 +0000 (11:02 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 29 Jan 2020 19:52:35 +0000 (20:52 +0100)
Rust 1.40 in strict mode will now fail the build on the
presence of unnecessary parentheses.

warning: unnecessary parentheses around type
  --> src/smb/smb2_ioctl.rs:41:12
   |
41 |         -> (&mut SMBTransaction)
   |            ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

(cherry picked from commit 5ee8323028aeb0d2c4926bae3bf8dafd05215d56)

rust/src/smb/dcerpc.rs
rust/src/smb/session.rs
rust/src/smb/smb.rs
rust/src/smb/smb2_ioctl.rs

index 109558b9ee63bc117a70a89bdb1dc78a2947b635..6d164a25efd99673da02d96465f1f32a50f1ed2e 100644 (file)
@@ -196,7 +196,7 @@ impl SMBTransactionDCERPC {
 
 impl SMBState {
     fn new_dcerpc_tx(&mut self, hdr: SMBCommonHdr, vercmd: SMBVerCmdStat, cmd: u8, call_id: u32)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
         tx.hdr = hdr;
@@ -211,7 +211,7 @@ impl SMBState {
     }
 
     fn new_dcerpc_tx_for_response(&mut self, hdr: SMBCommonHdr, vercmd: SMBVerCmdStat, call_id: u32)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
         tx.hdr = hdr;
index 9f35c6d7c7ff991e537d101a6e71803393e89a9e..1103dde03ded28440ff0ad8f5598beb51dbd4145 100644 (file)
@@ -42,7 +42,7 @@ impl SMBTransactionSessionSetup {
 
 impl SMBState {
     pub fn new_sessionsetup_tx(&mut self, hdr: SMBCommonHdr)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
 
index 5611dd4cf47c1d168f79159727e79087ca5c1602..44bc40a8e324f376413be3774c59ef7465b8415b 100644 (file)
@@ -393,7 +393,7 @@ impl SMBTransactionSetFilePathInfo {
 impl SMBState {
     pub fn new_setfileinfo_tx(&mut self, filename: Vec<u8>, fid: Vec<u8>,
             subcmd: u16, loi: u16, delete_on_close: bool)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
 
@@ -411,7 +411,7 @@ impl SMBState {
 
     pub fn new_setpathinfo_tx(&mut self, filename: Vec<u8>,
             subcmd: u16, loi: u16, delete_on_close: bool)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
 
@@ -446,7 +446,7 @@ impl SMBTransactionRename {
 
 impl SMBState {
     pub fn new_rename_tx(&mut self, fuid: Vec<u8>, oldname: Vec<u8>, newname: Vec<u8>)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
 
@@ -933,7 +933,7 @@ impl SMBState {
      * track a single cmd request/reply pair. */
 
     pub fn new_generic_tx(&mut self, smb_ver: u8, smb_cmd: u16, key: SMBCommonHdr)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
         if smb_ver == 1 && smb_cmd <= 255 {
@@ -1007,7 +1007,7 @@ impl SMBState {
     }
 
     pub fn new_negotiate_tx(&mut self, smb_ver: u8)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
         if smb_ver == 1 {
@@ -1049,7 +1049,7 @@ impl SMBState {
     }
 
     pub fn new_treeconnect_tx(&mut self, hdr: SMBCommonHdr, name: Vec<u8>)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
 
index 43ce24270ef852cd4424de67c2721ac2cfebf56c..ffa434444aa33aea528fe5a86c1f001bd6d0fb0d 100644 (file)
@@ -39,7 +39,7 @@ impl SMBTransactionIoctl {
 
 impl SMBState {
     pub fn new_ioctl_tx(&mut self, hdr: SMBCommonHdr, func: u32)
-        -> (&mut SMBTransaction)
+        -> &mut SMBTransaction
     {
         let mut tx = self.new_tx();
         tx.hdr = hdr;