Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust_version: [stable, 1.82.0]
rust_version: [stable, 1.87.0]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
fail-fast: false
matrix:
target: [aarch64-unknown-linux-gnu]
rust_version: [stable, 1.82.0]
rust_version: [stable, 1.87.0]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The C2PA Rust library has been tested on:

## Requirements

The C2PA Rust library requires **Rust version 1.82.0** or newer.
The C2PA Rust library requires **Rust version 1.87.0** or newer.

To use the library, add this to your `Cargo.toml`:

Expand Down
2 changes: 1 addition & 1 deletion export_schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.36.1"
authors = ["Dave Kozma <dkozma@adobe.com>"]
license = "MIT OR Apache-2.0"
edition = "2018"
rust-version = "1.82.0"
rust-version = "1.87.0"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(test)'] }
Expand Down
2 changes: 1 addition & 1 deletion make_test_images/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.49.5"
authors = ["Gavin Peacock <gpeacock@adobe.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.82.0"
rust-version = "1.87.0"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(test)'] }
Expand Down
2 changes: 1 addition & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ readme = "../README.md"
keywords = ["xmp", "metadata"]
categories = ["api-bindings"]
edition = "2021"
rust-version = "1.82.0"
rust-version = "1.87.0"
exclude = ["tests/fixtures"]

[package.metadata.docs.rs]
Expand Down
1 change: 1 addition & 0 deletions sdk/src/assertions/uuid_assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
};

/// Helper class to create User assertion
#[allow(dead_code)]
#[derive(Debug, Default)]
pub struct Uuid {
label: String,
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/asset_handlers/svg_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl AssetIO for SvgIO {
}

// create manifest entry
fn create_manifest_tag(data: &[u8], with_meta: bool) -> Result<Event> {
fn create_manifest_tag(data: &[u8], with_meta: bool) -> Result<Event<'_>> {
let output: Vec<u8> = Vec::with_capacity(data.len() + 256);
let mut writer = Writer::new(Cursor::new(output));

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/crypto/ec_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl EcdsaCurve {
/// Parse an ASN.1 DER object that contains a P1363 format into its components.
///
/// This format is used by C2PA to describe ECDSA signature keys.
pub(crate) fn parse_ec_der_sig(data: &[u8]) -> BerResult<EcSigComps> {
pub(crate) fn parse_ec_der_sig(data: &[u8]) -> BerResult<'_, EcSigComps<'_>> {
parse_der_sequence_defined_g(|content: &[u8], _| {
let (rem1, r) = parse_der_integer(content)?;
let (_rem2, s) = parse_der_integer(rem1)?;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/dynamic_assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct PartialClaim {

impl PartialClaim {
/// Return an iterator over the assertions in this Claim.
pub fn assertions(&self) -> Iter<HashedUri> {
pub fn assertions(&self) -> Iter<'_, HashedUri> {
self.assertion_uris.iter()
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/identity/claim_aggregation/w3c_vc/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl DidBuf {
}
}

pub fn as_did(&self) -> Did {
pub fn as_did(&self) -> Did<'_> {
unsafe {
// SAFETY: we validated the data in `Self::new`.
Did::new_unchecked(&self.0)
Expand Down
6 changes: 3 additions & 3 deletions sdk/src/ingredient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ impl Ingredient {
}

/// Returns thumbnail tuple Some((format, bytes)) or None.
pub fn thumbnail(&self) -> Option<(&str, Cow<Vec<u8>>)> {
pub fn thumbnail(&self) -> Option<(&str, Cow<'_, Vec<u8>>)> {
self.thumbnail
.as_ref()
.and_then(|t| Some(t.format.as_str()).zip(self.resources.get(&t.identifier).ok()))
}

/// Returns a Cow of thumbnail bytes or Err(Error::NotFound)`.
pub fn thumbnail_bytes(&self) -> Result<Cow<Vec<u8>>> {
pub fn thumbnail_bytes(&self) -> Result<Cow<'_, Vec<u8>>> {
match self.thumbnail.as_ref() {
Some(thumbnail) => self.resources.get(&thumbnail.identifier),
None => Err(Error::NotFound),
Expand Down Expand Up @@ -313,7 +313,7 @@ impl Ingredient {
/// Returns a copy on write ref to the manifest data bytes or None`.
///
/// manifest_data is the binary form of a manifest store in .c2pa format.
pub fn manifest_data(&self) -> Option<Cow<Vec<u8>>> {
pub fn manifest_data(&self) -> Option<Cow<'_, Vec<u8>>> {
self.manifest_data
.as_ref()
.and_then(|r| self.resources.get(&r.identifier).ok())
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ impl Manifest {
self.title.as_deref()
}

/// Returns thumbnail tuple with Some((format, bytes)) or None
pub fn thumbnail(&self) -> Option<(&str, Cow<Vec<u8>>)> {
/// Returns thumbnail tuple with Some((format, bytes)) or `None`.
pub fn thumbnail(&self) -> Option<(&str, Cow<'_, Vec<u8>>)> {
self.thumbnail
.as_ref()
.and_then(|t| Some(t.format.as_str()).zip(self.resources.get(&t.identifier).ok()))
Expand Down Expand Up @@ -223,8 +223,8 @@ impl Manifest {
&self.assertions
}

/// Returns raw assertion references
pub fn assertion_references(&self) -> Iter<HashedUri> {
/// Returns raw assertion references.
pub fn assertion_references(&self) -> Iter<'_, HashedUri> {
self.assertion_references.iter()
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/resource_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl ResourceStore {
/// Returns a copy on write reference to the resource if found.
///
/// Returns [`Error::ResourceNotFound`] if it cannot find a resource matching that ID.
pub fn get(&self, id: &str) -> Result<Cow<Vec<u8>>> {
pub fn get(&self, id: &str) -> Result<Cow<'_, Vec<u8>>> {
#[cfg(feature = "file_io")]
if !self.resources.contains_key(id) {
match self.base_path.as_ref() {
Expand Down
1 change: 1 addition & 0 deletions sdk/src/utils/cbor_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ impl fmt::Display for UriT {
}
}

#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BytesT(pub Vec<u8>);

Expand Down
Loading