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()), (Vec::<RawCue>::new(), Vec::<RawAdtlMember>::new()),
|(mut cues, mut adtls), (cue, label, note, ltxt)| { |(mut cues, mut adtls), (cue, label, note, ltxt)| {
cues.push(cue); cues.push(cue);
label.map(|l| adtls.push(RawAdtlMember::Label(l))); if let Some(l) = label {
note.map(|n| adtls.push(RawAdtlMember::Note(n))); adtls.push(RawAdtlMember::Label(l))
ltxt.map(|m| adtls.push(RawAdtlMember::LabeledText(m))); }
if let Some(n) = note {
adtls.push(RawAdtlMember::Note(n))
}
if let Some(m) = ltxt {
adtls.push(RawAdtlMember::LabeledText(m))
}
(cues, adtls) (cues, adtls)
}, },
) )