Showing the changes to git-commitgraph/src/graph (1 of 5 files). Show all
Unified · Split
| @@ -1,15 +1,15 @@ | |||
| 1 | use crate::graph::GraphPosition; | 1 | use crate::graph::GraphPosition; |
| 2 | use crate::graph_file::{GraphFile, LexPosition}; | 2 | use crate::graph_file::{GraphFile, LexPosition}; |
| 3 | use crate::{CommitData, Graph}; | 3 | use crate::{Commit, Graph}; |
| 4 | use git_object::borrowed; | 4 | use git_object::borrowed; |
| 5 | 5 | ||
| 6 | impl Graph { | 6 | impl 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 | ||