@contentauth/c2pa-node 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.rs CHANGED
@@ -46,25 +46,27 @@ pub fn parse_settings(
46
46
  Some(js_value) => {
47
47
  if js_value.is_a::<JsString, _>(cx) {
48
48
  let settings_string = js_value
49
- .downcast::<JsString, _>(cx).map_err(|_| Error::Signing(format!("{}: Expected settings string", error_prefix)))?
49
+ .downcast::<JsString, _>(cx)
50
+ .map_err(|_| {
51
+ Error::Signing(format!("{error_prefix}: Expected settings string"))
52
+ })?
50
53
  .value(cx);
51
54
 
52
55
  // Create context with settings
53
56
  let context = Context::new()
54
57
  .with_settings(settings_string.as_str())
55
- .map_err(|e| Error::Signing(format!("{}: Invalid settings: {}", error_prefix, e)))?;
56
-
58
+ .map_err(|e| {
59
+ Error::Signing(format!("{error_prefix}: Invalid settings: {e}"))
60
+ })?;
57
61
  Ok(Some(context))
58
62
  } else if js_value.is_a::<JsNull, _>(cx) || js_value.is_a::<JsUndefined, _>(cx) {
59
63
  Ok(None)
60
64
  } else {
61
65
  Err(Error::Signing(format!(
62
- "{}: Settings must be a string, null, or undefined",
63
- error_prefix
66
+ "{error_prefix}: Settings must be a string, null, or undefined",
64
67
  )))
65
68
  }
66
69
  }
67
70
  None => Ok(None),
68
71
  }
69
72
  }
70
-