Actions
Optimization #4497
closedrust: clean up constructors of state, transaction structs
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