c2pa-rs

A fork of https://github.com/contentauth/c2pa-rs/
git clone git://archive.git.mtrnord.blog/mtrnords-photography-manager/c2pa-rs.git
Log | Files | Refs | README

commit 2723117d95d8e234ea20d1425c1be6fba2046400
parent 75bc275b14d5662306859fe14d2ba29b5a141c80
Author: Gavin  Peacock <gpeacock@adobe.com>
Date:   Thu, 13 Jul 2023 12:11:40 -0700

Return ResourceNotFound  instead of NotFound for resource get (#279)

return ResourceNotFound  instead of NotFound for resource get
Diffstat:
Msdk/src/resource_store.rs | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sdk/src/resource_store.rs b/sdk/src/resource_store.rs @@ -211,9 +211,10 @@ impl ResourceStore { None => return Err(Error::ResourceNotFound(id.to_string())), } } - self.resources - .get(id) - .map_or_else(|| Err(Error::NotFound), |v| Ok(Cow::Borrowed(v))) + self.resources.get(id).map_or_else( + || Err(Error::ResourceNotFound(id.to_string())), + |v| Ok(Cow::Borrowed(v)), + ) } /// Returns true if the resource has been added or exists as file.