Skip to content

Commit

Permalink
replace once_cell::sync::OnceCell into std::sync::OnceLock
Browse files Browse the repository at this point in the history
  • Loading branch information
White-Green committed Jan 6, 2024
1 parent 0fec809 commit cc25ef0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ default-members = [

[dependencies]
ndarray = { version = "0.15.6", optional = true }
once_cell = "1.19.0"
world_sys = { path = "./world_sys" }
20 changes: 10 additions & 10 deletions src/signal_analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::options::{CheapTrickOption, D4COption, HarvestOption};
use crate::spectrogram_like::SpectrogramLike;
use once_cell::sync::OnceCell;
use std::sync::OnceLock;
use world_sys::{CheapTrick, GetSamplesForHarvest, Harvest, D4C};

struct HarvestResult {
Expand All @@ -14,9 +14,9 @@ pub struct SignalAnalyzer {
harvest_option: HarvestOption,
cheaptrick_option: CheapTrickOption,
d4c_option: D4COption,
harvest_result: OnceCell<HarvestResult>,
spectrogram: OnceCell<SpectrogramLike<f64>>,
aperiodicity: OnceCell<SpectrogramLike<f64>>,
harvest_result: OnceLock<HarvestResult>,
spectrogram: OnceLock<SpectrogramLike<f64>>,
aperiodicity: OnceLock<SpectrogramLike<f64>>,
}

pub struct AnalyzeResult {
Expand Down Expand Up @@ -92,9 +92,9 @@ impl SignalAnalyzer {
harvest_option,
cheaptrick_option,
d4c_option,
harvest_result: OnceCell::new(),
spectrogram: OnceCell::new(),
aperiodicity: OnceCell::new(),
harvest_result: OnceLock::new(),
spectrogram: OnceLock::new(),
aperiodicity: OnceLock::new(),
}
}

Expand All @@ -107,9 +107,9 @@ impl SignalAnalyzer {
harvest_option: HarvestOption::new(),
cheaptrick_option: CheapTrickOption::new(fs),
d4c_option: D4COption::new(),
harvest_result: OnceCell::new(),
spectrogram: OnceCell::new(),
aperiodicity: OnceCell::new(),
harvest_result: OnceLock::new(),
spectrogram: OnceLock::new(),
aperiodicity: OnceLock::new(),
}
}

Expand Down

0 comments on commit cc25ef0

Please sign in to comment.