Divided analyzing logic into submodules. #105
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This breaks the different parts of
analyze.rs
into separate files.The different analyses are grouped together in
analyze::commands
, to differentiate them from the files that are responsible for formatting output into text tables or JSON, which are found inanalyze::formats
. The different analyses, i.e.top
,diff
, and so forth are re-exported fromanalyze.rs
using apub use
statement.Aside from organizational work, this commit as few changes as possible to the code itself. The only changes made are:
extern crate
statements inanalyze.rs
do not alias the other twiggy crates. These are aliased when they are imported within the commands files, so that no other code changes.analyze::commands
are divided into 3 groups, following advice from this issue. Imports from standard libraries come first, followed by imports from external crates, and imports from other crates in the project coming third.with_header
andadd_row
methods for theformats::Table
struct have had thepub
keyword added, so they can be used in thecommands
submodule. This module is not publicly exported from theanalyze
crate however, so I don't believe this has an effect on their visibility elsewhere.