Commit e36441ad authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'commitid-into-string'

06c83ba8 rust: prefer Into<String> over ToString
Acked-by: Kitware Robot's avatarKitware Robot <>
Merge-request: !72
parents 715408c5 06c83ba8
......@@ -11,6 +11,7 @@
* `error-chain` is no longer used. Instead, custom error types are used. This
means that errors from this crate no longer allocate (except where a
`String` needs to be stored for messaging purposes).
* `Into<String>` is used for `CommitId` and `Identity` construction methods.
# v3.1.2
......@@ -128,8 +128,8 @@ pub(crate) type GitResult<T> = Result<T, GitError>;
impl CommitId {
/// Create a new `CommitId`.
pub fn new<I: ToString>(id: I) -> Self {
pub fn new<I: Into<String>>(id: I) -> Self {
/// The commit as a string reference.
......@@ -166,12 +166,12 @@ impl Identity {
/// Create a new identity.
pub fn new<N, E>(name: N, email: E) -> Self
N: ToString,
E: ToString,
N: Into<String>,
E: Into<String>,
Self {
name: name.to_string(),
email: email.to_string(),
name: name.into(),
email: email.into(),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment