From b06cfdf1696444972260e8860e244bd7a09795fa Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Tue, 6 Feb 2024 13:03:46 +0100 Subject: [PATCH] fix #211 --- pdf/src/primitive.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pdf/src/primitive.rs b/pdf/src/primitive.rs index df9c396..00b51bd 100644 --- a/pdf/src/primitive.rs +++ b/pdf/src/primitive.rs @@ -766,9 +766,7 @@ impl Object for Date { match p.resolve(r)? { Primitive::String (PdfString {data}) => { let s = str::from_utf8(&data)?; - let len = s.len(); - if len > 2 && &s[0..2] == "D:" { - + if s.starts_with("D:") { let year = match s.get(2..6) { Some(year) => { str::parse::(year)?