Skip to content

Commit

Permalink
Accept everything that can be turned into a string (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy authored and yoshuawuyts committed Aug 6, 2018
1 parent ede4e24 commit 2e64a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use man::prelude::*;

fn main() {
let msg = Manual::new("auth-service")
.about("authorize & authenticate members".into())
.about("authorize & authenticate members")
.arg(Arg::new("path"))
.env(Env::new("PORT").help("The network port to listen to"))
.flag(
Expand Down
4 changes: 2 additions & 2 deletions src/man.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl Manual {
}

/// Add a description.
pub fn about(mut self, about: String) -> Self {
self.about = Some(about);
pub fn about<S: Into<String>>(mut self, about: S) -> Self {
self.about = Some(about.into());
self
}

Expand Down

0 comments on commit 2e64a4e

Please sign in to comment.