Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Use .as_str() and remove useless .to_string()
  • Loading branch information
Scott Piriou committed Jul 1, 2020
commit 66a8c331a69f4e2f226ce0328aabe73cabc57451
16 changes: 8 additions & 8 deletions client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ pub trait SubstrateCli: Sized {
{
let app = <Self as StructOpt>::clap();

let mut full_version = Self::impl_version().to_string();
let mut full_version = Self::impl_version();
full_version.push_str("\n");

let name = Self::executable_name();
let author = Self::author();
let about = Self::description();
let app = app
.name(&*name)
.author(&*author)
.about(&*about)
.name(name)
.author(author.as_str())
.about(about.as_str())
.version(full_version.as_str())
.settings(&[
AppSettings::GlobalVersion,
Expand Down Expand Up @@ -186,16 +186,16 @@ pub trait SubstrateCli: Sized {
{
let app = <Self as StructOpt>::clap();

let mut full_version = Self::impl_version().to_string();
let mut full_version = Self::impl_version();
full_version.push_str("\n");

let name = Self::executable_name();
let author = Self::author();
let about = Self::description();
let app = app
.name(&*name)
.author(&*author)
.about(&*about)
.name(name)
.author(author.as_str())
.about(about.as_str())
.version(full_version.as_str());

let matches = app.get_matches_from_safe(iter)?;
Expand Down