Skip to content

Commit 093f7c8

Browse files
committed
refactor: rename precise_full_git_fragment to precise_git_fragment
1 parent ce551d7 commit 093f7c8

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/cargo/core/source_id.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,6 @@ impl SourceId {
460460
}
461461

462462
pub fn precise_git_fragment(self) -> Option<&'static str> {
463-
self.precise_full_git_fragment().map(|s| &s[..8])
464-
}
465-
466-
pub fn precise_full_git_fragment(self) -> Option<&'static str> {
467463
match &self.inner.precise {
468464
Some(Precise::GitUrlFragment(s)) => Some(&s),
469465
_ => None,

src/cargo/ops/cargo_generate_lockfile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub fn update_lockfile(ws: &Workspace<'_>, opts: &UpdateOptions<'_>) -> CargoRes
167167
format!(
168168
"{} -> #{}",
169169
removed[0],
170-
&added[0].source_id().precise_git_fragment().unwrap()
170+
&added[0].source_id().precise_git_fragment().unwrap()[..8],
171171
)
172172
} else {
173173
format!("{} -> v{}", removed[0], added[0].version())

src/cargo/sources/git/source.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'cfg> GitSource<'cfg> {
103103
let remote = GitRemote::new(source_id.url());
104104
// Fallback to git ref from mainfest if there is no locked revision.
105105
let locked_rev = source_id
106-
.precise_full_git_fragment()
106+
.precise_git_fragment()
107107
.map(|s| Revision::new(s.into()))
108108
.unwrap_or_else(|| source_id.git_reference().unwrap().clone().into());
109109

@@ -199,7 +199,6 @@ impl From<Revision> for GitReference {
199199
}
200200
}
201201

202-
203202
/// Create an identifier from a URL,
204203
/// essentially turning `proto://host/path/repo` into `repo-<hash-of-url>`.
205204
fn ident(id: &SourceId) -> String {

0 commit comments

Comments
 (0)