Skip to content

Commit 9ca6d89

Browse files
committed
cleanup code
1 parent 2c0cac6 commit 9ca6d89

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

rust/signed_doc/examples/mk_signed_doc.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
//! Catalyst signed document cli example
22
3-
#![allow(
4-
missing_docs,
5-
clippy::missing_docs_in_private_items,
6-
dead_code,
7-
unused_variables
8-
)]
3+
#![allow(missing_docs, clippy::missing_docs_in_private_items)]
94

105
use std::{
116
fs::{read_to_string, File},
@@ -101,7 +96,7 @@ fn decode_cbor_ulid(val: &coset::cbor::Value) -> anyhow::Result<ulid::Ulid> {
10196
bytes
10297
.clone()
10398
.try_into()
104-
.map_err(|e| anyhow::anyhow!("Invalid CBOR encoded ULID type, invalid bytes size"))?,
99+
.map_err(|_| anyhow::anyhow!("Invalid CBOR encoded ULID type, invalid bytes size"))?,
105100
);
106101
Ok(ulid)
107102
}
@@ -121,7 +116,7 @@ fn decode_cbor_uuid(val: &coset::cbor::Value) -> anyhow::Result<uuid::Uuid> {
121116
bytes
122117
.clone()
123118
.try_into()
124-
.map_err(|e| anyhow::anyhow!("Invalid CBOR encoded UUID type, invalid bytes size"))?,
119+
.map_err(|_| anyhow::anyhow!("Invalid CBOR encoded UUID type, invalid bytes size"))?,
125120
);
126121
Ok(uuid)
127122
}
@@ -195,15 +190,6 @@ fn load_schema_from_file(schema_path: &PathBuf) -> anyhow::Result<jsonschema::JS
195190
Ok(schema)
196191
}
197192

198-
fn load_schema_from_str(schema_str: &str) -> anyhow::Result<jsonschema::JSONSchema> {
199-
let schema_json = serde_json::from_str(schema_str)?;
200-
let schema = jsonschema::JSONSchema::options()
201-
.with_draft(jsonschema::Draft::Draft7)
202-
.compile(&schema_json)
203-
.map_err(|e| anyhow::anyhow!("{e}"))?;
204-
Ok(schema)
205-
}
206-
207193
fn load_json_from_file<T>(path: &PathBuf) -> anyhow::Result<T>
208194
where T: for<'de> serde::Deserialize<'de> {
209195
let file = File::open(path)?;

0 commit comments

Comments
 (0)