Skip to content

String support #60

@fernandobatels

Description

@fernandobatels

Hi, maybe is a my mistake, but i cant use the String type with 'stdout', only the str type.

    let mut main = Command::main_binary().unwrap();

    main.arg("tags")
        .arg("list")
        .arg("--use-csv");

    let stdout = String::from("\"Name\",\"#id\"");

    // stdout.push_str ....
    // stdout.push_str ....
    // stdout.push_str ....
  
    main.assert()
        .success()
        .stdout(stdout.as_str());

On run this, i receive error[E0597]: stdout does not live long enough. I cant use .stdout(stdout.as_str());, because i receive the trait assert_cmd::assert::IntoOutputPredicate<_> is not implemented for std::string::String.

Where am I going wrong :( ?

Thank you in advance for your attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions