Skip to content

Commit

Permalink
Refactor constructor name
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspustina committed Jan 11, 2020
1 parent d980e10 commit 4f14d18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
* [ ] https://github.com/rust-lang/api-guidelines
* [ ] https://deterministic.space/elegant-apis-in-rust.html
* [ ] Activate deny missing docs and add docs
* [ ] https://rust-lang.github.io/api-guidelines/documentation.html

6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ pub struct Profile {

impl Profile {
pub fn new<T: Into<String> + Clone>(name: T, commands: &[T]) -> Profile {
Self::with_description(name, commands, None)
Self::new_with_description(name, commands, None)
}

pub fn with_description<T: Into<String> + Clone>(name: T, commands: &[T], description: Option<T>) -> Profile {
pub fn new_with_description<T: Into<String> + Clone>(name: T, commands: &[T], description: Option<T>) -> Profile {
let name = name.into();
let commands = commands.iter().map(|x| x.clone().into()).collect();
let commands = commands.clone().to_vec().into_iter().map(Into::into).collect();
let description = description.map(Into::into);

Profile {
Expand Down

0 comments on commit 4f14d18

Please sign in to comment.