Project

General

Profile

Actions

Optimization #4497

closed

rust: clean up constructors of state, transaction structs

Added by Victor Julien almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

Older code uses a lot of:

impl SMBVerCmdStat {
    pub fn new() -> SMBVerCmdStat {
        return SMBVerCmdStat {
            ...

Newer code uses Self:
impl RdpTransaction {
    fn new(id: u64, item: RdpTransactionItem) -> Self {
        Self {
           ...

Or even the Default logic like in:
pub struct IKEState {
    tx_id: u64,
    pub transactions: Vec<IKETransaction>,

    pub ikev1_container: Ikev1Container,
    pub ikev2_container: Ikev2Container,
}

By switching to Default by default we can clean things up, and where Default isn't feasible the use of Self is preferred.

Actions #1

Updated by Victor Julien almost 3 years ago

  • Description updated (diff)
Actions #2

Updated by Jeff Lucovsky almost 3 years ago

  • Status changed from Assigned to In Progress
Actions #3

Updated by Jeff Lucovsky almost 3 years ago

  • Status changed from In Progress to In Review
Actions #4

Updated by Jeff Lucovsky almost 3 years ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF