use cloned rather than a map that clones

This commit is contained in:
Corwin 2024-01-13 10:31:00 +00:00
parent 1132bc2383
commit e13d844f1f
No known key found for this signature in database

View file

@ -243,7 +243,7 @@ static CHIP_INFO: InitOnce<&'static ChipInfo> = InitOnce::new();
fn cached_chip_info() -> Result<&'static ChipInfo, Error> {
CHIP_INFO
.try_get(|| -> Result<_, Error> { Ok(FlashChipType::detect()?.chip_info()) })
.map(Clone::clone)
.cloned()
}
/// Actual implementation of the ChipInfo functions.