History

[commitgraph] Rename CommitData -> Commit.

Conor Davis committed 6 years ago

Commit d8c20071 parent 7c405ab5 files · +18 −18Browse files

Showing the changes to git-commitgraph/src/graph (1 of 5 files). Show all

Unified · Split

git-commitgraph/src/graph/access.rs+4−4
@@ -1,15 +1,15 @@
1use crate::graph::GraphPosition;1use crate::graph::GraphPosition;
2use crate::graph_file::{GraphFile, LexPosition};2use crate::graph_file::{GraphFile, LexPosition};
3use crate::{CommitData, Graph};3use crate::{Commit, Graph};
4use git_object::borrowed;4use git_object::borrowed;
5 5
6impl Graph {6impl Graph {
7 pub fn commit_at(&self, pos: GraphPosition) -> CommitData<'_> {7 pub fn commit_at(&self, pos: GraphPosition) -> Commit<'_> {
8 let r = self.lookup_by_pos(pos);8 let r = self.lookup_by_pos(pos);
9 r.file.commit_at(r.lex_pos)9 r.file.commit_at(r.lex_pos)
10 }10 }
11 11
12 pub fn commit_by_id(&self, id: borrowed::Id<'_>) -> Option<CommitData<'_>> {12 pub fn commit_by_id(&self, id: borrowed::Id<'_>) -> Option<Commit<'_>> {
13 let r = self.lookup_by_id(id)?;13 let r = self.lookup_by_id(id)?;
14 Some(r.file.commit_at(r.lex_pos))14 Some(r.file.commit_at(r.lex_pos))
15 }15 }
@@ -20,7 +20,7 @@ impl Graph { · 4 unmodified lines
20 }20 }
21 21
22 /// Iterate over commits in unsorted order.22 /// Iterate over commits in unsorted order.
23 pub fn iter_commits(&self) -> impl Iterator<Item = CommitData<'_>> {23 pub fn iter_commits(&self) -> impl Iterator<Item = Commit<'_>> {
24 self.files.iter().flat_map(|file| file.iter_commits())24 self.files.iter().flat_map(|file| file.iter_commits())
25 }25 }
26 26