Skip to content

Commit

Permalink
style: added [non_exhaustive] attribute to some enums:
Browse files Browse the repository at this point in the history
* Source;
* Error;
* RegularMethods.
  • Loading branch information
amv-dev committed Jun 4, 2021
1 parent ac68a81 commit bf0e133
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/candles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::core::{Error, ValueType, OHLCV};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))]
#[non_exhaustive]
pub enum Source {
/// *Close* part of a candle
Close,
Expand Down
1 change: 1 addition & 0 deletions src/core/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// Crate errors enum
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum Error {
/// Error parsing string to [`Source`](crate::core::Source)
SourceParse(String),
Expand Down
1 change: 1 addition & 0 deletions src/helpers/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub type RegularMethod =
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))]
#[non_exhaustive]
pub enum RegularMethods {
/// [Simple Moving Average](crate::methods::SMA)
SMA,
Expand Down

0 comments on commit bf0e133

Please sign in to comment.