Skip to content

Pass String to description #1336

Closed
Closed
@jmaargh

Description

@jmaargh

How do I send a heap String to App::description?

Rust Version and Affected Version of clap

Rust 2018 from the playground

Bug Summary

Can't pass a String either by-value or by borrow to about. Error message:

error[E0277]: the trait bound `&str: std::convert::From<&std::string::String>` is not satisfied
  --> src/main.rs:12:34
   |
12 |     let matches = App::new(NAME).about(&description).get_matches();
   |                                  ^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `&str`
   |
   = note: required because of the requirements on the impl of `std::convert::Into<&str>` for `&std::string::String`

Sample Code or Link to Sample Code

https://play.rust-lang.org/?gist=15667c16c7d853ce4a668dfb453948b6&version=nightly&mode=debug&edition=2018

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions