MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / validate

Method validate

src/series.rs:499–512  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

497 }
498
499 pub(super) fn validate(&self) -> Result<(), SeriesError> {
500 if self.positions.is_empty() {
501 return Err(SeriesError::Empty);
502 }
503 if self.marker_style.is_none() && self.line_style.is_none() {
504 return Err(SeriesError::NoMarkersAndNoLines);
505 }
506 if let Some(colors) = &self.point_colors
507 && colors.len() != self.positions.len()
508 {
509 return Err(SeriesError::InvalidPointColorsLength);
510 }
511 Ok(())
512 }
513}

Callers 1

add_seriesMethod · 0.80

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected