aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-05-05 19:18:22 +0200
committerTeddy Wing2021-05-05 19:18:22 +0200
commit5b0a85a5b9e3664c98d068e8f9268a4788fba33c (patch)
tree2c25b4e727f1b13ecf295c8126a3a1cec2e45f65
parent5b8b835b4835e79fe10e5e1b315f4d43fbc85089 (diff)
downloadpdf-form-replace-font-5b0a85a5b9e3664c98d068e8f9268a4788fba33c.tar.bz2
Move PDF appearance key to a named constant
Explain what the string means.
-rw-r--r--src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 6bd4e70..e3e9101 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -26,6 +26,9 @@ use std::env;
use std::process;
+const PDF_TEXT_FIELD_DEFAULT_APPEARANCE_KEY: &'static str = "DA";
+
+
fn main() {
match run() {
Ok(_) => (),
@@ -92,7 +95,7 @@ fn run () -> Result<(), anyhow::Error> {
let key = std::str::from_utf8(k)
.context("unable to convert PDF object key to UTF-8")?;
- if key == "DA" {
+ if key == PDF_TEXT_FIELD_DEFAULT_APPEARANCE_KEY {
let properties = v.as_str_mut()
.context("unable to get properties of form field")?;