clippy: Prefer if let Some(_) over Option::map

This commit is contained in:
Ian Hobson
2023-05-12 16:52:06 +02:00
parent ceb8c4371e
commit 86ffd4310a

View File

@@ -344,9 +344,15 @@ impl Cue {
(Vec::<RawCue>::new(), Vec::<RawAdtlMember>::new()),
|(mut cues, mut adtls), (cue, label, note, ltxt)| {
cues.push(cue);
label.map(|l| adtls.push(RawAdtlMember::Label(l)));
note.map(|n| adtls.push(RawAdtlMember::Note(n)));
ltxt.map(|m| adtls.push(RawAdtlMember::LabeledText(m)));
if let Some(l) = label {
adtls.push(RawAdtlMember::Label(l))
}
if let Some(n) = note {
adtls.push(RawAdtlMember::Note(n))
}
if let Some(m) = ltxt {
adtls.push(RawAdtlMember::LabeledText(m))
}
(cues, adtls)
},
)