pub fn patch(self, user: &mut User) {
        let UserPatch {
            id: pid,
            username: pusername,
            avatar: pavatar,
            relations: prelations,
            badges: pbadges,
            status: pstatus,
            relationship: prelationship,
            online: ponline,
            flags: pflags,
            bot: pbot,
            profile_content: pprofile_content,
            profile_background: pprofile_background,
        } = self;
        let User {
            id,
            username,
            avatar,
            relations,
            badges,
            status,
            relationship,
            online,
            flags,
            bot,
            profile,
        } = user;

        if let Some(pid) = pid {
            *id = pid;
        }
        if let Some(pusername) = pusername {
            *username = pusername;
        }
        if let Some(pavatar) = pavatar {
            *avatar = Some(pavatar);
        }
        if let Some(prelations) = prelations {
            *relations = prelations;
        }
        if let Some(pbadges) = pbadges {
            *badges = Some(pbadges);
        }
        if let Some(pstatus) = pstatus {
            *status = Some(pstatus);
        }
        if let Some(prelationship) = prelationship {
            *relationship = Some(prelationship);
        }
        if let Some(ponline) = ponline {
            *online = Some(ponline);
        }
        if let Some(pflags) = pflags {
            *flags = Some(pflags);
        }
        if let Some(pbot) = pbot {
            *bot = Some(pbot);
        }
        if let Some(pprofile_content) = pprofile_content {
            profile.get_or_insert(Default::default()).content = Some(pprofile_content);
        }
        if let Some(pprofile_background) = pprofile_background {
            profile.get_or_insert(Default::default()).background = Some(pprofile_background);
        }
    }
/// Treats the [`PartialUser`] as a list of modifications
/// that have to be applied to the given user, and applies
/// them.
Treats the [`PartialUser`] as a list of modifications
that have to be applied to the given user, and applies
them.
Treats the [ ` PartialUser ` ] as a list of modifications that have to be applied to the given user and applies them .
pub fn patch(self, user: &mut User) {
        let UserPatch {
            id: pid,
            username: pusername,
            avatar: pavatar,
            relations: prelations,
            badges: pbadges,
            status: pstatus,
            relationship: prelationship,
            online: ponline,
            flags: pflags,
            bot: pbot,
            profile_content: pprofile_content,
            profile_background: pprofile_background,
        } = self;
        let User {
            id,
            username,
            avatar,
            relations,
            badges,
            status,
            relationship,
            online,
            flags,
            bot,
            profile,
        } = user;
        if let Some(pid) = pid {
            *id = pid;
        }
        if let Some(pusername) = pusername {
            *username = pusername;
        }
        if let Some(pavatar) = pavatar {
            *avatar = Some(pavatar);
        }
        if let Some(prelations) = prelations {
            *relations = prelations;
        }
        if let Some(pbadges) = pbadges {
            *badges = Some(pbadges);
        }
        if let Some(pstatus) = pstatus {
            *status = Some(pstatus);
        }
        if let Some(prelationship) = prelationship {
            *relationship = Some(prelationship);
        }
        if let Some(ponline) = ponline {
            *online = Some(ponline);
        }
        if let Some(pflags) = pflags {
            *flags = Some(pflags);
        }
        if let Some(pbot) = pbot {
            *bot = Some(pbot);
        }
        if let Some(pprofile_content) = pprofile_content {
            profile.get_or_insert(Default::default()).content = Some(pprofile_content);
        }
        if let Some(pprofile_background) = pprofile_background {
            profile.get_or_insert(Default::default()).background = Some(pprofile_background);
        }
    }
pub fn patch ( self , user : & mut User ) { let UserPatch { id : pid , username : pusername , avatar : pavatar , relations : prelations , badges : pbadges , status : pstatus , relationship : prelationship , online : ponline , flags : pflags , bot : pbot , profile_content : pprofile_content , profile_background : pprofile_background , } = self ; let User { id , username , avatar , relations , badges , status , relationship , online , flags , bot , profile , } = user ; if let Some ( pid ) = pid { * id = pid ; } if let Some ( pusername ) = pusername { * username = pusername ; } if let Some ( pavatar ) = pavatar { * avatar = Some ( pavatar ) ; } if let Some ( prelations ) = prelations { * relations = prelations ; } if let Some ( pbadges ) = pbadges { * badges = Some ( pbadges ) ; } if let Some ( pstatus ) = pstatus { * status = Some ( pstatus ) ; } if let Some ( prelationship ) = prelationship { * relationship = Some ( prelationship ) ; } if let Some ( ponline ) = ponline { * online = Some ( ponline ) ; } if let Some ( pflags ) = pflags { * flags = Some ( pflags ) ; } if let Some ( pbot ) = pbot { * bot = Some ( pbot ) ; } if let Some ( pprofile_content ) = pprofile_content { profile . get_or_insert ( Default :: default ( ) ) . content = Some ( pprofile_content ) ; } if let Some ( pprofile_background ) = pprofile_background { profile . get_or_insert ( Default :: default ( ) ) . background = Some ( pprofile_background ) ; } }
Treats the [`PartialUser`] as a list of modifications
that have to be applied to the given user, and applies
them.
Treats the [ ` PartialUser ` ] as a list of modifications that have to be applied to the given user and applies them .
self
user
&mut User
self
user
&mut User