Skip to content

Commit 22f53a6

Browse files
NeutroniSiegeLord
authored andcommitted
cargo clippy fix
1 parent 8a1dde9 commit 22f53a6

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

gnuplot/src/datatype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl DataType for Duration
7272
}
7373
}
7474

75-
impl<'l> DataType for &'l Duration
75+
impl DataType for &Duration
7676
{
7777
fn get(&self) -> f64
7878
{

gnuplot/src/figure.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::io::{BufWriter, Write};
1616
use std::path::{Path, PathBuf};
1717
use std::process::{Child, Command, Stdio};
1818
use std::str;
19-
use tempfile;
2019

2120
enum AxesVariant
2221
{
@@ -175,7 +174,7 @@ impl Figure
175174
.as_ref()
176175
.and_then(|d| d.path().to_str())
177176
.map(|s| s.into()),
178-
data_tempdir: data_tempdir,
177+
data_tempdir,
179178
}
180179
}
181180

@@ -194,7 +193,7 @@ impl Figure
194193
if self
195194
.data_directory
196195
.as_ref()
197-
.map(|s| s == "")
196+
.map(|s| s.is_empty())
198197
.unwrap_or(false)
199198
{
200199
self.data_directory = self
@@ -402,7 +401,7 @@ impl Figure
402401

403402
if let Ok(version_string) = str::from_utf8(&output.stdout)
404403
{
405-
let parts: Vec<_> = version_string.split(|c| c == ' ' || c == '.').collect();
404+
let parts: Vec<_> = version_string.split([' ', '.']).collect();
406405
if parts.len() > 2 && parts[0] == "gnuplot"
407406
{
408407
if let (Ok(major), Ok(minor)) =

gnuplot/src/options.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub enum PlotOption<T>
7878
BoxWidth(Vec<f64>),
7979
}
8080

81-
impl<'l> OneWayOwned for PlotOption<&'l str>
81+
impl OneWayOwned for PlotOption<&str>
8282
{
8383
type Output = PlotOption<String>;
8484
fn to_one_way_owned(&self) -> Self::Output
@@ -258,7 +258,7 @@ pub enum LabelOption<T>
258258
MarkerSize(f64),
259259
}
260260

261-
impl<'l> OneWayOwned for LabelOption<&'l str>
261+
impl OneWayOwned for LabelOption<&str>
262262
{
263263
type Output = LabelOption<String>;
264264
fn to_one_way_owned(&self) -> Self::Output
@@ -295,7 +295,7 @@ pub enum TickOption<T>
295295
Format(T),
296296
}
297297

298-
impl<'l> OneWayOwned for TickOption<&'l str>
298+
impl OneWayOwned for TickOption<&str>
299299
{
300300
type Output = TickOption<String>;
301301
fn to_one_way_owned(&self) -> Self::Output
@@ -376,7 +376,7 @@ pub enum LegendOption<T>
376376
MaxCols(u32),
377377
}
378378

379-
impl<'l> OneWayOwned for LegendOption<&'l str>
379+
impl OneWayOwned for LegendOption<&str>
380380
{
381381
type Output = LegendOption<String>;
382382
fn to_one_way_owned(&self) -> Self::Output
@@ -433,7 +433,7 @@ pub enum PaletteType<T>
433433
Custom(T),
434434
}
435435

436-
impl<'l> OneWayOwned for PaletteType<&'l [(f32, f32, f32, f32)]>
436+
impl OneWayOwned for PaletteType<&[(f32, f32, f32, f32)]>
437437
{
438438
type Output = PaletteType<Vec<(f32, f32, f32, f32)>>;
439439
fn to_one_way_owned(&self) -> Self::Output
@@ -472,9 +472,9 @@ impl PaletteType<Vec<(f32, f32, f32, f32)>>
472472
}
473473
Formula(r, g, b) =>
474474
{
475-
assert!(r >= -36 && r <= 36, "Invalid r formula!");
476-
assert!(g >= -36 && g <= 36, "Invalid g formula!");
477-
assert!(b >= -36 && b <= 36, "Invalid b formula!");
475+
assert!((-36..=36).contains(&r), "Invalid r formula!");
476+
assert!((-36..=36).contains(&g), "Invalid g formula!");
477+
assert!((-36..=36).contains(&b), "Invalid b formula!");
478478
writeln!(w, "set palette rgbformulae {},{},{}", r, g, b);
479479
}
480480
CubeHelix(start, rev, sat, gamma) =>

gnuplot/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub(crate) trait OneWayOwned
161161
fn to_one_way_owned(&self) -> Self::Output;
162162
}
163163

164-
impl<'l, T: OneWayOwned> OneWayOwned for &'l [T]
164+
impl<T: OneWayOwned> OneWayOwned for &[T]
165165
{
166166
type Output = Vec<<T as OneWayOwned>::Output>;
167167
fn to_one_way_owned(&self) -> Self::Output

0 commit comments

Comments
 (0)