Skip to content

Commit b4c160f

Browse files
Fix formatting
1 parent d3f0492 commit b4c160f

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

rust/signed_doc/src/validator/rules/chain/mod.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
//! `chain` rule type impl.
22
33
use anyhow::ensure;
4-
use catalyst_signed_doc_spec::{is_required::IsRequired, metadata::chain::Chain};
5-
use catalyst_signed_doc_spec::metadata::collaborators::Collaborators;
6-
use crate::{
7-
CatalystSignedDocument, providers::CatalystSignedDocumentProvider,
4+
use catalyst_signed_doc_spec::{
5+
is_required::IsRequired,
6+
metadata::{chain::Chain, collaborators::Collaborators},
87
};
98

9+
use crate::{CatalystSignedDocument, providers::CatalystSignedDocumentProvider};
10+
1011
#[cfg(test)]
1112
mod tests;
1213

@@ -24,16 +25,22 @@ pub(crate) enum ChainRule {
2425

2526
impl ChainRule {
2627
/// Generating `ChainRule` from specs
27-
pub(crate) fn new(spec: &Chain, collaborators_spec: &Collaborators) -> anyhow::Result<Self> {
28+
pub(crate) fn new(
29+
spec: &Chain,
30+
collaborators_spec: &Collaborators,
31+
) -> anyhow::Result<Self> {
2832
let optional = match spec.required {
2933
IsRequired::Yes => false,
3034
IsRequired::Optional => true,
3135
IsRequired::Excluded => {
3236
return Ok(Self::NotSpecified);
33-
}
37+
},
3438
};
3539

36-
ensure!(matches!(collaborators_spec.required, IsRequired::Excluded), "Chained Documents do not support collaborators");
40+
ensure!(
41+
matches!(collaborators_spec.required, IsRequired::Excluded),
42+
"Chained Documents do not support collaborators"
43+
);
3744

3845
Ok(Self::Specified { optional })
3946
}

rust/signed_doc/src/validator/rules/chain/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use test_case::test_case;
44

55
use super::*;
66
use crate::{
7-
builder::tests::Builder, metadata::SupportedField, providers::tests::TestCatalystProvider,
8-
Chain, DocType,
7+
Chain, DocType, builder::tests::Builder, metadata::SupportedField,
8+
providers::tests::TestCatalystProvider,
99
};
1010

1111
mod helper {

rust/signed_doc/src/validator/rules/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
//! <https://input-output-hk.github.io/catalyst-libs/architecture/08_concepts/signed_doc/meta/>
33
44
use anyhow::Context;
5-
use catalyst_signed_doc_spec::{cddl_definitions::CddlDefinitions, DocSpec, DocSpecs};
5+
use catalyst_signed_doc_spec::{DocSpec, DocSpecs, cddl_definitions::CddlDefinitions};
66
use futures::FutureExt;
77

88
use crate::{
9-
providers::{CatalystIdProvider, CatalystSignedDocumentProvider},
109
CatalystSignedDocument,
10+
providers::{CatalystIdProvider, CatalystSignedDocumentProvider},
1111
};
1212

1313
mod chain;

0 commit comments

Comments
 (0)