Skip to content

Commit

Permalink
Update to latest rust
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed Dec 12, 2021
1 parent 61d3717 commit 0605fd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ Contributions and bug fixes are encouraged! However, we may not merge PRs that i

1. Edit `Cargo.toml` and bump the version.
1. Edit CHANGELOG.txt
1. Run `cargo clippy` and `cargo fmt`.
1. Recompile (`cargo build`).
1. `git add -p`
1. `git ci -m 'Bumping to vx.x.x'`
Expand Down
14 changes: 4 additions & 10 deletions src/training_sample_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ use crate::training_cache;
use rand::seq::IteratorRandom;

#[derive(Debug)]
pub struct TrainingSampleGenerator<'a> {
settings: &'a Settings,
history: &'a History,
pub struct TrainingSampleGenerator {
data_set: Vec<(Features, bool)>,
}

impl<'a> TrainingSampleGenerator<'a> {
pub fn new(settings: &'a Settings, history: &'a History) -> TrainingSampleGenerator<'a> {
impl TrainingSampleGenerator {
pub fn new(settings: &Settings, history: &History) -> TrainingSampleGenerator {
let cache_path = Settings::mcfly_training_cache_path();
let data_set = if settings.refresh_training_cache || !cache_path.exists() {
let ds = TrainingSampleGenerator::generate_data_set(history);
Expand All @@ -23,11 +21,7 @@ impl<'a> TrainingSampleGenerator<'a> {
training_cache::read(&cache_path)
};

TrainingSampleGenerator {
settings,
history,
data_set,
}
TrainingSampleGenerator { data_set }
}

pub fn generate_data_set(history: &History) -> Vec<(Features, bool)> {
Expand Down

0 comments on commit 0605fd8

Please sign in to comment.