Skip to content

Commit

Permalink
feat(complete): Allow any OsString-compatible type to be a Completion…
Browse files Browse the repository at this point in the history
…Candidate
  • Loading branch information
epage committed Aug 21, 2024
1 parent bb6493e commit 951762d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clap_complete/src/engine/candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ impl CompletionCandidate {
self.hidden
}
}

impl<S: Into<OsString>> From<S> for CompletionCandidate {
fn from(s: S) -> Self {
CompletionCandidate::new(s.into())
}
}

0 comments on commit 951762d

Please sign in to comment.