Skip to content

Commit 7c758d2

Browse files
committed
clippy
1 parent 7b8d43d commit 7c758d2

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

src/aisle/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl AisleConf<'_> {
9090

9191
for name in &igr.names {
9292
let info = IngredientInfo {
93-
name: *name,
93+
name,
9494
common_name,
9595
category: cat.name,
9696
};

src/analysis/event_consumer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct Locations<'i> {
130130

131131
const IMPLICIT_REF_WARN: &str = "The reference (&) is implicit";
132132

133-
impl<'i, 'c> RecipeCollector<'i, 'c> {
133+
impl<'i> RecipeCollector<'i, '_> {
134134
fn parse_events(mut self, mut events: impl Iterator<Item = Event<'i>>) -> AnalysisResult {
135135
enum BlockBuffer {
136136
Step(Vec<Item>),
@@ -247,7 +247,7 @@ impl<'i, 'c> RecipeCollector<'i, 'c> {
247247
let mut to_remove = Vec::new();
248248
for (key, value) in self.content.metadata.map.iter() {
249249
if let Some(sk) = key.as_str().and_then(|s| StdKey::from_str(s).ok()) {
250-
match check_std_entry(sk, value, &self.converter) {
250+
match check_std_entry(sk, value, self.converter) {
251251
Ok(Some(servings)) => self.content.data = servings,
252252
Ok(None) => {}
253253
Err(err) => {

src/convert/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl BestConversions {
388388
Some(Arc::clone(&converter.all_units[best_id]))
389389
}
390390

391-
fn all_units<'c>(&'c self, converter: &'c Converter) -> impl Iterator<Item = &Arc<Unit>> {
391+
fn all_units<'c>(&'c self, converter: &'c Converter) -> impl Iterator<Item = &'c Arc<Unit>> {
392392
self.0.iter().map(|(_, uid)| &converter.all_units[*uid])
393393
}
394394
}

src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn value_as_tags(val: &serde_yaml::Value) -> Result<Vec<&str>, MetadataError> {
269269
let entries = if let Some(s) = val.as_str() {
270270
s.split(',').map(|e| e.trim()).collect()
271271
} else if let Some(seq) = val.as_sequence() {
272-
seq.into_iter()
272+
seq.iter()
273273
.map(|val| val.as_str())
274274
.collect::<Option<Vec<&str>>>()
275275
.ok_or(MetadataError::UnexpectedType)?

src/model.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl Ingredient<Value> {
252252
pub fn all_quantities<'a>(
253253
&'a self,
254254
all_ingredients: &'a [Self],
255-
) -> impl Iterator<Item = &ScaledQuantity> {
255+
) -> impl Iterator<Item = &'a ScaledQuantity> {
256256
std::iter::once(self.quantity.as_ref())
257257
.chain(
258258
self.relation
@@ -332,7 +332,7 @@ impl Cookware<Value> {
332332
}
333333

334334
/// Gets an iterator over all quantities of this ingredient and its references.
335-
pub fn all_amounts<'a>(&'a self, all_cookware: &'a [Self]) -> impl Iterator<Item = &Value> {
335+
pub fn all_amounts<'a>(&'a self, all_cookware: &'a [Self]) -> impl Iterator<Item = &'a Value> {
336336
std::iter::once(self.quantity.as_ref())
337337
.chain(
338338
self.relation
@@ -533,9 +533,9 @@ pub struct Timer<V: QuantityValue = Value> {
533533
/// If created from parsing the following applies:
534534
///
535535
/// - If the [`ADVANCED_UNITS`](crate::Extensions::ADVANCED_UNITS) extension
536-
/// is enabled, this is guaranteed to have a time unit and a non text value.
536+
/// is enabled, this is guaranteed to have a time unit and a non text value.
537537
///
538538
/// - If the [`TIMER_REQUIRES_TIME`](crate::Extensions::TIMER_REQUIRES_TIME)
539-
/// extension is enabled, this is guaranteed to be [`Some`].
539+
/// extension is enabled, this is guaranteed to be [`Some`].
540540
pub quantity: Option<Quantity<V>>,
541541
}

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ fn parse_block(block: &mut BlockParser, old_style_metadata: bool) {
367367
let key_t = key.text_outer_trimmed();
368368
let is_config_key = key_t.starts_with('[') && key_t.ends_with(']');
369369
let modes_active = bp.extension(Extensions::MODES);
370-
return (is_config_key && modes_active) || old_style_metadata;
370+
(is_config_key && modes_active) || old_style_metadata
371371
})
372372
}),
373373
T![=] => block.with_recover(section),

src/parser/token_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<'i> TokenStream<'i> {
2222
}
2323
}
2424

25-
impl<'i> Iterator for TokenStream<'i> {
25+
impl Iterator for TokenStream<'_> {
2626
type Item = Token;
2727

2828
fn next(&mut self) -> Option<Self::Item> {

src/scale.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl ScalableRecipe {
130130
pub fn scale(self, target: u32, converter: &Converter) -> ScaledRecipe {
131131
let target = if let Servings(Some(servings)) = &self.data {
132132
let base = servings.first().copied().unwrap_or(1);
133-
ScaleTarget::new(base, target, &servings)
133+
ScaleTarget::new(base, target, servings)
134134
} else {
135135
ScaleTarget::new(1, target, &[])
136136
};

0 commit comments

Comments
 (0)