Skip to content

Commit e70dc9a

Browse files
committed
add license, remove unused code
1 parent d87a37d commit e70dc9a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/builder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2020-2024 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
use anyhow::Context as _;
25
use itertools::Itertools;
36
use serde::Serialize;
@@ -14,6 +17,7 @@ use crate::Result;
1417
use crate::SdJwt;
1518
use crate::SdJwtClaims;
1619
use crate::SdObjectEncoder;
20+
#[cfg(feature = "sha")]
1721
use crate::Sha256Hasher;
1822
use crate::DEFAULT_SALT_SIZE;
1923
use crate::HEADER_TYP;

src/encoder.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ pub struct SdObjectEncoder<H> {
3636
impl TryFrom<Value> for SdObjectEncoder<Sha256Hasher> {
3737
type Error = crate::Error;
3838
fn try_from(value: Value) -> Result<Self> {
39-
Self::with_custom_hasher(value, Sha256Hasher::new())
39+
Self::with_custom_hasher_and_salt_size(value, Sha256Hasher::new(), DEFAULT_SALT_SIZE)
4040
}
4141
}
4242

4343
impl<H: Hasher> SdObjectEncoder<H> {
44-
/// Creates a new [`SdObjectEncoder`] with custom hash function to create digests.
45-
pub fn with_custom_hasher(object: Value, hasher: H) -> Result<Self> {
46-
Self::with_custom_hasher_and_salt_size(object, hasher, DEFAULT_SALT_SIZE)
47-
}
4844
/// Creates a new [`SdObjectEncoder`] with custom hash function to create digests, and custom salt size.
4945
pub fn with_custom_hasher_and_salt_size(object: Value, hasher: H, salt_size: usize) -> Result<Self> {
5046
if !object.is_object() {

src/jwt.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2020-2024 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
use std::fmt::Display;
25
use std::str::FromStr;
36

src/signer.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2020-2024 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
use std::error::Error;
25

36
use async_trait::async_trait;

0 commit comments

Comments
 (0)