pub fn patch(self, role: &mut Role) {
        let PartialRole {
            name: pname,
            permissions: ppermissions,
            color: pcolor,
            hoist: phoist,
            rank: prank,
        } = self;
        let Role {
            name,
            permissions,
            color,
            hoist,
            rank,
        } = role;

        if let Some(pname) = pname {
            *name = pname;
        }
        if let Some(ppermissions) = ppermissions {
            *permissions = ppermissions;
        }
        if let Some(pcolor) = pcolor {
            *color = Some(pcolor);
        }
        if let Some(phoist) = phoist {
            *hoist = Some(phoist);
        }
        if let Some(prank) = prank {
            *rank = Some(prank);
        }
    }
/// Treat self as a patch and apply it to role.
Treat self as a patch and apply it to role.
Treat self as a patch and apply it to role .
pub fn patch(self, role: &mut Role) {
        let PartialRole {
            name: pname,
            permissions: ppermissions,
            color: pcolor,
            hoist: phoist,
            rank: prank,
        } = self;
        let Role {
            name,
            permissions,
            color,
            hoist,
            rank,
        } = role;
        if let Some(pname) = pname {
            *name = pname;
        }
        if let Some(ppermissions) = ppermissions {
            *permissions = ppermissions;
        }
        if let Some(pcolor) = pcolor {
            *color = Some(pcolor);
        }
        if let Some(phoist) = phoist {
            *hoist = Some(phoist);
        }
        if let Some(prank) = prank {
            *rank = Some(prank);
        }
    }
pub fn patch ( self , role : & mut Role ) { let PartialRole { name : pname , permissions : ppermissions , color : pcolor , hoist : phoist , rank : prank , } = self ; let Role { name , permissions , color , hoist , rank , } = role ; if let Some ( pname ) = pname { * name = pname ; } if let Some ( ppermissions ) = ppermissions { * permissions = ppermissions ; } if let Some ( pcolor ) = pcolor { * color = Some ( pcolor ) ; } if let Some ( phoist ) = phoist { * hoist = Some ( phoist ) ; } if let Some ( prank ) = prank { * rank = Some ( prank ) ; } }
Treat self as a patch and apply it to role.
Treat self as a patch and apply it to role .
self
role
&mut Role
self
role
&mut Role