Skip to content
Signed in as shautvast
Your gists Starred gists Help
Your GitHub profile
/ ... /
shautvast / Type `#` for issues and pull requests, `>` for commands, and `?` for help Type `#` for issues, pull requests, and projects, `>` for commands, and `?` for help Type `#` for issues, pull requests, and projects, `/` for files, and `>` for commands
We’ve encountered an error and some results aren't available at this time. Type a new search or try again later.
No results matched your search
Search for issues and pull requests `#` Search for issues, pull requests, discussions, and projects `#` Search for organizations, repositories, and users `@` Search for projects `!` Search for files `/` Activate command mode `>` Search your issues, pull requests, and discussions `# author:@me` Search your issues, pull requests, and discussions `# author:@me` Filter to pull requests `# is:pr` Filter to issues `# is:issue` Filter to discussions `# is:discussion` Filter to projects `# is:project` Filter to open issues, pull requests, and discussions `# is:open`

# Editing main_use_of_moved_value.rs

Drop one or more files here to prefill your gist!

fn main() { let name1 = String::from("Bob"); let msg = get_hello(name); println!("{}", msg); //let msg2 = get_hello(name); -- ERROR Use of moved value //println!("{}", msg2); } fn get_hello(name: String){ return "Hello " + name; }

    xxxxxxxxxx

9
10
1

    fn main() {

2

        let name1 = String::from("Bob");

3

        let msg = get_hello(name);

4

        println!("{}", msg);

5

    ​

6

        //let msg2 = get_hello(name); -- ERROR Use of moved value

7

        //println!("{}", msg2);

8

    }

9

    ​

10

    fn get_hello(name: String){

11

        return "Hello " + name;

12

    }

Attach files by selecting or pasting them.
Uploading your files… We don’t support that file type. Try again with a GIF, JPEG, JPG, MOV, MP4, PNG, SVG, CSV, DOCX, FODG, FODP, FODS, FODT, GZ, LOG, MD, ODF, ODG, ODP, ODS, ODT, PDF, PPTX, TXT, XLS, XLSX or ZIP. Attaching documents requires write permission to this repository. Try again with a GIF, JPEG, JPG, MOV, MP4, PNG, SVG, CSV, DOCX, FODG, FODP, FODS, FODT, GZ, LOG, MD, ODF, ODG, ODP, ODS, ODT, PDF, PPTX, TXT, XLS, XLSX or ZIP. We don’t support that file type. Try again with a GIF, JPEG, JPG, MOV, MP4, PNG, SVG, CSV, DOCX, FODG, FODP, FODS, FODT, GZ, LOG, MD, ODF, ODG, ODP, ODS, ODT, PDF, PPTX, TXT, XLS, XLSX or ZIP. This file is empty. Try again with a file that’s not empty. This file is hidden. Try again with another file. Something went really wrong, and we can’t process that file. Try again.
Styling with Markdown is supported

Loading preview…

No changes to display.

Unable to load this preview, sorry.

Cancel
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.