diff options
author | Teddy Wing | 2019-11-02 06:26:20 +0100 |
---|---|---|
committer | Teddy Wing | 2019-11-02 06:26:20 +0100 |
commit | 8fb0408e1d4e50a25cd900237976f3ee310e1da8 (patch) | |
tree | 9e6376632525434804925bd1de5f6f2f8e9c2dd8 /src | |
parent | 4f3a200e6525c9e6075c1daf3b78db03703be22a (diff) | |
download | pdf-urls-8fb0408e1d4e50a25cd900237976f3ee310e1da8.tar.bz2 |
Add license (GNU GPLv3+)
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.rs | 17 | ||||
-rw-r--r-- | src/lib.rs | 19 | ||||
-rw-r--r-- | src/main.rs | 17 |
3 files changed, 52 insertions, 1 deletions
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 <https://www.gnu.org/licenses/>. + use std::fmt; use std::error; use std::str; @@ -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 <https://www.gnu.org/licenses/>. + mod errors; extern crate lopdf; @@ -32,7 +49,7 @@ pub fn get_urls_from_pdf<P: AsRef<Path>>(path: P) -> Result<Vec<String>> { 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 <https://www.gnu.org/licenses/>. + extern crate exitcode; use std::env; |