From 42943b7077f9e8e45dce061ebe54e53afa0cd04b Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Tue, 18 Apr 2023 14:59:05 +0200 Subject: [PATCH] use iter::Copied (MSRV: 1.36) --- src/offset/local/tz_info/parser.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/offset/local/tz_info/parser.rs b/src/offset/local/tz_info/parser.rs index 5652a0ea95..7bcf307e8c 100644 --- a/src/offset/local/tz_info/parser.rs +++ b/src/offset/local/tz_info/parser.rs @@ -7,7 +7,6 @@ use super::rule::TransitionRule; use super::timezone::{LeapSecond, LocalTimeType, TimeZone, Transition}; use super::Error; -#[allow(clippy::map_clone)] // MSRV: 1.36 pub(super) fn parse(bytes: &[u8]) -> Result { let mut cursor = Cursor::new(bytes); let state = State::new(&mut cursor, true)?; @@ -66,8 +65,8 @@ pub(super) fn parse(bytes: &[u8]) -> Result { leap_seconds.push(LeapSecond::new(unix_leap_time, correction)); } - let std_walls_iter = state.std_walls.iter().map(|&i| i).chain(iter::repeat(0)); - let ut_locals_iter = state.ut_locals.iter().map(|&i| i).chain(iter::repeat(0)); + let std_walls_iter = state.std_walls.iter().copied().chain(iter::repeat(0)); + let ut_locals_iter = state.ut_locals.iter().copied().chain(iter::repeat(0)); if std_walls_iter.zip(ut_locals_iter).take(state.header.type_count).any(|pair| pair == (0, 1)) { return Err(Error::InvalidTzFile( "invalid couple of standard/wall and UT/local indicators",