Skip to content

Commit b33cb14

Browse files
committed
Implement Clippy suggestions
1 parent e03b25b commit b33cb14

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl Figure {
188188
Python::with_gil(|py| {
189189
let fig = getattr!(py, figure, "Figure")
190190
.call0(py).unwrap();
191-
Ok(Self { fig: fig.into() })
191+
Ok(Self { fig })
192192
})
193193
}
194194

@@ -311,7 +311,7 @@ pub fn figure() -> Result<Figure, Error> {
311311
let pyplot = PYPLOT.as_ref()?;
312312
Python::with_gil(|py| {
313313
let fig = getattr!(py, pyplot, "figure").call0(py)?;
314-
Ok(Figure { fig: fig.into() })
314+
Ok(Figure { fig })
315315
})
316316
}
317317

@@ -703,46 +703,39 @@ impl<'a> PlotOptions<'a> {
703703

704704
/// Declare methods to set the options assuming `self.options` exists.
705705
macro_rules! set_plotoptions { () => {
706-
#[must_use]
707706
pub fn fmt(mut self, fmt: &'a str) -> Self {
708707
self.options.fmt = fmt;
709708
self
710709
}
711710

712-
#[must_use]
713711
pub fn animated(mut self) -> Self {
714712
self.options.animated = true;
715713
self
716714
}
717715

718-
#[must_use]
719716
pub fn antialiased(mut self, b: bool) -> Self {
720717
self.options.antialiased = b;
721718
self
722719
}
723720

724721
/// Label the plot with `label`. Note that labels are not shown
725722
/// by default; one must call [`Axes::legend`] to display them.
726-
#[must_use]
727723
pub fn label(mut self, label: impl Into<Cow<'a, str>>) -> Self {
728724
self.options.label = label.into();
729725
self
730726
}
731727

732-
#[must_use]
733728
pub fn linewidth(mut self, w: f64) -> Self {
734729
self.options.linewidth = Some(w);
735730
self
736731
}
737732

738-
#[must_use]
739733
pub fn markersize(mut self, w: f64) -> Self {
740734
self.options.markersize = Some(w);
741735
self
742736
}
743737

744738
/// Set the color of the plot.
745-
#[must_use]
746739
pub fn color(mut self, color: impl Color) -> Self {
747740
self.options.color = Some(color.rgba());
748741
self

0 commit comments

Comments
 (0)