Skip to content

How does the solution for move_semantic3 work? #2060

@dataCobra

Description

@dataCobra

Hello,

I just completed move_semantics3.rs and was wondering how does the mut in front of a parameter work.

The variable vec0 is not mutable as a variable and also vectors don't have copy implemented.

How does the function make the given vec0 borrowed variable mutable?

I couldn't find an explanation and hope you can enlighten me.

Best regards
dataCobra

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions