Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Ben Boeckel
rust-git-workarea
Commits
06c83ba8
Commit
06c83ba8
authored
Oct 13, 2019
by
Ben Boeckel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rust: prefer Into<String> over ToString
parent
715408c5
Pipeline
#148321
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
CHANGELOG.md
CHANGELOG.md
+1
-0
src/git.rs
src/git.rs
+6
-6
No files found.
CHANGELOG.md
View file @
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
...
...
src/git.rs
View file @
06c83ba8
...
...
@@ -128,8 +128,8 @@ pub(crate) type GitResult<T> = Result<T, GitError>;
impl
CommitId
{
/// Create a new `CommitId`.
pub
fn
new
<
I
:
To
String
>
(
id
:
I
)
->
Self
{
CommitId
(
id
.to
_string
())
pub
fn
new
<
I
:
Into
<
String
>
>
(
id
:
I
)
->
Self
{
CommitId
(
id
.
in
to
())
}
/// 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
where
N
:
To
String
,
E
:
To
String
,
N
:
Into
<
String
>
,
E
:
Into
<
String
>
,
{
Self
{
name
:
name
.to
_string
(),
email
:
email
.to
_string
(),
name
:
name
.
in
to
(),
email
:
email
.
in
to
(),
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment