Skip to content

with_stdin will take the ownership of command #22

@mssun

Description

@mssun

The with_stdin will take the ownership of command. Therefore you cannot write chained functions like this:

Command::new("cat")
    .arg("-A")
    .with_stdin("42")
    .assert()
    .success();

Error:

error[E0507]: cannot move out of borrowed content
  --> /xxx.rs:43:5
   |
43 | /     Command::new("cat")
44 | |         .arg("-A")
   | |__________________^ cannot move out of borrowed content

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions