From 8fb0408e1d4e50a25cd900237976f3ee310e1da8 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Sat, 2 Nov 2019 06:26:20 +0100
Subject: Add license (GNU GPLv3+)
---
src/errors.rs | 17 +++++++++++++++++
src/lib.rs | 19 ++++++++++++++++++-
src/main.rs | 17 +++++++++++++++++
3 files changed, 52 insertions(+), 1 deletion(-)
(limited to 'src')
diff --git a/src/errors.rs b/src/errors.rs
index 641c81b..1de18c6 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -1,3 +1,20 @@
+// Copyright (c) 2019 Teddy Wing
+//
+// This file is part of PDF-URLs.
+//
+// PDF-URLs is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// PDF-URLs is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with PDF-URLs. If not, see .
+
use std::fmt;
use std::error;
use std::str;
diff --git a/src/lib.rs b/src/lib.rs
index fb0b75d..8e4da1b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,20 @@
+// Copyright (c) 2019 Teddy Wing
+//
+// This file is part of PDF-URLs.
+//
+// PDF-URLs is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// PDF-URLs is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with PDF-URLs. If not, see .
+
mod errors;
extern crate lopdf;
@@ -32,7 +49,7 @@ pub fn get_urls_from_pdf>(path: P) -> Result> {
if key == "URI" {
match v {
Object::String(s, _) => {
- urls.push(String::from_utf8(s.to_vec())?);
+ urls.push(String::from_utf8_lossy(s).to_string());
},
_ => (),
}
diff --git a/src/main.rs b/src/main.rs
index 3f77e96..9c1fd97 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,20 @@
+// Copyright (c) 2019 Teddy Wing
+//
+// This file is part of PDF-URLs.
+//
+// PDF-URLs is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// PDF-URLs is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with PDF-URLs. If not, see .
+
extern crate exitcode;
use std::env;
--
cgit v1.2.3