Skip to content

Commit

Permalink
fix #211
Browse files Browse the repository at this point in the history
  • Loading branch information
s3bk committed Feb 6, 2024
1 parent 5c19ff6 commit b06cfdf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pdf/src/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u16>(year)?
Expand Down

0 comments on commit b06cfdf

Please sign in to comment.