diff options
author | Teddy Wing | 2021-05-05 19:18:22 +0200 |
---|---|---|
committer | Teddy Wing | 2021-05-05 19:18:22 +0200 |
commit | 5b0a85a5b9e3664c98d068e8f9268a4788fba33c (patch) | |
tree | 2c25b4e727f1b13ecf295c8126a3a1cec2e45f65 | |
parent | 5b8b835b4835e79fe10e5e1b315f4d43fbc85089 (diff) | |
download | pdf-form-replace-font-5b0a85a5b9e3664c98d068e8f9268a4788fba33c.tar.bz2 |
Move PDF appearance key to a named constant
Explain what the string means.
-rw-r--r-- | src/main.rs | 5 |
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")?; |