diff --git a/src/graph.rs b/src/graph.rs index 23a5a31..77db2bd 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -34,10 +34,6 @@ pub struct GitGraph { pub indices: HashMap, /// All detected branches and tags, including merged and deleted pub all_branches: Vec, - /// Indices of all real (still existing) branches in `all_branches` - pub branches: Vec, - /// Indices of all tags in `all_branches` - pub tags: Vec, /// The current HEAD pub head: HeadInfo, } @@ -155,37 +151,11 @@ impl GitGraph { } } - let branches = all_branches - .iter() - .enumerate() - .filter_map(|(idx, br)| { - if !br.is_merged && !br.is_tag { - Some(idx) - } else { - None - } - }) - .collect(); - - let tags = all_branches - .iter() - .enumerate() - .filter_map(|(idx, br)| { - if !br.is_merged && br.is_tag { - Some(idx) - } else { - None - } - }) - .collect(); - Ok(GitGraph { repository, commits: filtered_commits, indices: filtered_indices, all_branches, - branches, - tags, head, }) } diff --git a/src/lib.rs b/src/lib.rs index 428d5bf..1e044dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,15 @@ //! 2. Lay out the graph structure according to the branching model (See [graph]) //! 3. Render the layout to text or SVG (See [mod@print]) +/* TODO git-graph has some complex functions, which make it hard to +understand and modify the code. The code should be made simpler +so the following warnings can be enabled without triggering. + +// Configure clippy to look for complex functions +#![warn(clippy::cognitive_complexity)] +#![warn(clippy::too_many_lines)] +*/ + use git2::Repository; use std::path::Path;