Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
Signed-off-by: DenisRybas <[email protected]>
  • Loading branch information
DenisRybas committed Feb 7, 2024
1 parent a596224 commit d0c3846
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions vdr/src/contracts/cl/types/schema.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::{error::VdrError, types::{ContractOutput, ContractParam}, Address, VdrResult, SchemaId};
use crate::{
error::VdrError,
types::{ContractOutput, ContractParam},
Address, SchemaId, VdrResult,
};

use crate::{contracts::did::types::did::DID, types::ContractEvent};
use serde_derive::{Deserialize, Serialize};
Expand Down Expand Up @@ -34,15 +38,19 @@ impl Schema {

fn require_version(&self) -> VdrResult<()> {
if self.version.is_empty() {
return Err(VdrError::InvalidSchema("Version is not provided".to_string()));
return Err(VdrError::InvalidSchema(
"Version is not provided".to_string(),
));
}

Ok(())
}

fn require_attributes(&self) -> VdrResult<()> {
if self.attr_names.is_empty() {
return Err(VdrError::InvalidSchema("Attributes are not provided".to_string()));
return Err(VdrError::InvalidSchema(
"Attributes are not provided".to_string(),
));
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion vdr/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub enum VdrError {
GetTransactionError(String),

#[error("Invalid schema: {}", _0)]
InvalidSchema(String)
InvalidSchema(String),
}

pub type VdrResult<T> = Result<T, VdrError>;
Expand Down

0 comments on commit d0c3846

Please sign in to comment.