Skip to content

Commit

Permalink
Refactor public visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspustina committed Jan 12, 2020
1 parent 7b6fe94 commit 5a59402
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
* Linux
* https://www.cyberciti.biz/tips/top-linux-monitoring-tools.html
* http://www.brendangregg.com/USEmethod/use-linux.html
* [ ] Re-work API
* [X] Re-work API
* [X] https://github.com/rust-lang/api-guidelines
* [ ] https://rust-lang.github.io/api-guidelines/flexibility.html#functions-minimize-assumptions-about-parameters-by-using-generics-c-generic
* [X] https://rust-lang.github.io/api-guidelines/flexibility.html#functions-minimize-assumptions-about-parameters-by-using-generics-c-generic
* [X] https://deterministic.space/elegant-apis-in-rust.html
* [ ] Activate deny missing docs and add docs
* [ ] https://rust-lang.github.io/api-guidelines/documentation.html
Expand Down
6 changes: 3 additions & 3 deletions examples/json_report.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use usereport::{renderer, runner, Analysis, Config, Renderer};
use usereport::{Analysis, Config, Renderer, ThreadRunner, JsonRenderer};

fn main() {
#[cfg(target_os = "macos")]
let config = Config::from_file("contrib/osx.conf").expect("Failed to load config file");
#[cfg(target_os = "linux")]
let config = Config::from_file("contrib/linux.conf").expect("Failed to load config file");

let runner = runner::ThreadRunner::new();
let runner = ThreadRunner::new();
let hostinfos = config.commands_for_hostinfo();
let analysis = Analysis::new(Box::new(runner), &hostinfos, &config.commands);
let report = analysis.run().expect("failed to run analysis");

let renderer = renderer::JsonRenderer::new();
let renderer = JsonRenderer::new();
let stdout = std::io::stdout();
let handle = stdout.lock();
renderer.render(&report, handle).expect("Failed to render to stdout");
Expand Down
6 changes: 3 additions & 3 deletions examples/md_report.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use usereport::{renderer, runner, Analysis, Config, Renderer};
use usereport::{HbsRenderer, Analysis, Config, Renderer, ThreadRunner};

fn main() {
#[cfg(target_os = "macos")]
Expand All @@ -8,12 +8,12 @@ fn main() {

let template = include_str!("../contrib/markdown.hbs");

let runner = runner::ThreadRunner::new();
let runner = ThreadRunner::new();
let hostinfos = config.commands_for_hostinfo();
let analysis = Analysis::new(Box::new(runner), &hostinfos, &config.commands);
let report = analysis.run().expect("failed to run analysis");

let renderer = renderer::HbsRenderer::new(template);
let renderer = HbsRenderer::new(template);
let stdout = std::io::stdout();
let handle = stdout.lock();
renderer.render(&report, handle).expect("Failed to render to stdout");
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub mod runner;
pub use analysis::{Analysis, AnalysisReport};
pub use command::{Command, CommandResult};
pub use config::Config;
pub use renderer::Renderer;
pub use renderer::{Renderer, JsonRenderer, HbsRenderer};
pub use runner::{Runner, ThreadRunner};

/// Test helper
Expand Down

0 comments on commit 5a59402

Please sign in to comment.