Skip to content

Commit

Permalink
Use new method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgdnrvsky committed Aug 19, 2024
1 parent 6b57ccc commit c5f18e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
5 changes: 5 additions & 0 deletions src/fetcher/mod_search/search_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ pub mod display_builder {
}
}

pub fn with_options(mut self, options: DisplayBuilderOptions) -> Self {
self.options = options;
self
}

pub fn with_id(mut self, value: bool) -> Self {
self.options.with_id = value;
self
Expand Down
15 changes: 1 addition & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,7 @@ fn main() -> anyhow::Result<()> {
};

if !no_print {
print!(
"{}",
the_mod
.display()
.with_id(display_options.with_id)
.with_name(display_options.with_name)
.with_slug(display_options.with_slug)
.with_summary(display_options.with_summary)
.with_links(display_options.with_links)
.with_thumbs_up_count(display_options.with_thumbs_up_count)
.with_download_count(display_options.with_download_count)
.with_files(display_options.with_files)
.with_indexes(display_options.with_indexes)
);
print!("{}", the_mod.display().with_options(display_options));
}
}
}
Expand Down

0 comments on commit c5f18e2

Please sign in to comment.