Skip to content
Snippets Groups Projects
Verified Commit 21f7adb8 authored by Loris Moulin's avatar Loris Moulin
Browse files

chore: fixed clippy errors

parent ae2e2aca
Branches
No related merge requests found
......@@ -130,7 +130,7 @@ impl GlobalSettingsBuilder {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidLocalIp(error).into()),
merge_errors(self.errors, FieldError::LocalIp(error).into()),
),
}
}
......
......@@ -208,7 +208,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidChain(error).into()),
merge_errors(self.errors, FieldError::Chain(error).into()),
),
}
}
......@@ -248,10 +248,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(
self.errors,
FieldError::InvalidGenesisWasmPath(error).into(),
),
merge_errors(self.errors, FieldError::GenesisWasmPath(error).into()),
),
}
}
......@@ -271,10 +268,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(
self.errors,
FieldError::InvalidGenesisWasmGenerator(error).into(),
),
merge_errors(self.errors, FieldError::GenesisWasmGenerator(error).into()),
),
}
}
......@@ -294,10 +288,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(
self.errors,
FieldError::InvalidGenesisStatePath(error).into(),
),
merge_errors(self.errors, FieldError::GenesisStatePath(error).into()),
),
}
}
......@@ -317,10 +308,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(
self.errors,
FieldError::InvalidGenesisStateGenerator(error).into(),
),
merge_errors(self.errors, FieldError::GenesisStateGenerator(error).into()),
),
}
}
......@@ -340,7 +328,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidChainSpecPath(error).into()),
merge_errors(self.errors, FieldError::ChainSpecPath(error).into()),
),
}
}
......@@ -366,7 +354,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> {
for (index, addr) in bootnodes_addresses.into_iter().enumerate() {
match addr.try_into() {
Ok(addr) => addrs.push(addr),
Err(error) => errors.push(FieldError::InvalidBootnodesAddress(index, error).into()),
Err(error) => errors.push(FieldError::BootnodesAddress(index, error).into()),
}
}
......
......@@ -109,7 +109,7 @@ macro_rules! common_builder_methods {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidDefaultImage(error).into()),
merge_errors(self.errors, FieldError::DefaultImage(error).into()),
),
}
}
......@@ -151,10 +151,7 @@ macro_rules! common_builder_methods {
),
Err(error) => Self::transition(
self.config,
merge_errors(
self.errors,
FieldError::InvalidDefaultDbSnapshot(error).into(),
),
merge_errors(self.errors, FieldError::DefaultDbSnapshot(error).into()),
),
}
}
......@@ -174,7 +171,7 @@ macro_rules! common_builder_methods {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidChainSpecPath(error).into()),
merge_errors(self.errors, FieldError::ChainSpecPath(error).into()),
),
}
}
......@@ -272,7 +269,7 @@ impl RelaychainConfigBuilder<Initial> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidChain(error).into()),
merge_errors(self.errors, FieldError::Chain(error).into()),
),
}
}
......@@ -296,7 +293,7 @@ impl RelaychainConfigBuilder<WithChain> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidDefaultCommand(error).into()),
merge_errors(self.errors, FieldError::DefaultCommand(error).into()),
),
}
}
......
......@@ -24,58 +24,58 @@ pub enum ConfigError<E> {
#[derive(thiserror::Error, Debug)]
pub enum FieldError<E> {
#[error("chain: {0}")]
InvalidChain(E),
Chain(E),
#[error("image: {0}")]
InvalidImage(E),
Image(E),
#[error("default_image: {0}")]
InvalidDefaultImage(E),
DefaultImage(E),
#[error("command: {0}")]
InvalidCommand(E),
Command(E),
#[error("default_command: {0}")]
InvalidDefaultCommand(E),
DefaultCommand(E),
#[error("db_snapshot: {0}")]
InvalidDbSnapshot(E),
DbSnapshot(E),
#[error("default_db_snapshot: {0}")]
InvalidDefaultDbSnapshot(E),
DefaultDbSnapshot(E),
#[error("bootnodes_addresses[{0}]: {1}")]
InvalidBootnodesAddress(usize, E),
BootnodesAddress(usize, E),
#[error("chain_spec_path: {0}")]
InvalidChainSpecPath(E),
ChainSpecPath(E),
#[error("genesis_wasm_path: {0}")]
InvalidGenesisWasmPath(E),
GenesisWasmPath(E),
#[error("genesis_wasm_generator: {0}")]
InvalidGenesisWasmGenerator(E),
GenesisWasmGenerator(E),
#[error("genesis_state_path: {0}")]
InvalidGenesisStatePath(E),
GenesisStatePath(E),
#[error("genesis_state_generator: {0}")]
InvalidGenesisStateGenerator(E),
GenesisStateGenerator(E),
#[error("local_ip: {0}")]
InvalidLocalIp(E),
LocalIp(E),
#[error("request_memory: {0}")]
InvalidRequestMemory(E),
RequestMemory(E),
#[error("request_cpu: {0}")]
InvalidRequestCpu(E),
RequestCpu(E),
#[error("limit_memory: {0}")]
InvalidLimitMemory(E),
LimitMemory(E),
#[error("limit_cpu: {0}")]
InvalidLimitCpu(E),
LimitCpu(E),
}
#[derive(thiserror::Error, Debug)]
......
......@@ -243,7 +243,7 @@ impl NodeConfigBuilder<Buildable> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidCommand(error).into()),
merge_errors(self.errors, FieldError::Command(error).into()),
),
}
}
......@@ -263,7 +263,7 @@ impl NodeConfigBuilder<Buildable> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidImage(error).into()),
merge_errors(self.errors, FieldError::Image(error).into()),
),
}
}
......@@ -335,7 +335,7 @@ impl NodeConfigBuilder<Buildable> {
for (index, addr) in bootnodes_addresses.into_iter().enumerate() {
match addr.try_into() {
Ok(addr) => addrs.push(addr),
Err(error) => errors.push(FieldError::InvalidBootnodesAddress(index, error).into()),
Err(error) => errors.push(FieldError::BootnodesAddress(index, error).into()),
}
}
......@@ -435,7 +435,7 @@ impl NodeConfigBuilder<Buildable> {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidDbSnapshot(error).into()),
merge_errors(self.errors, FieldError::DbSnapshot(error).into()),
),
}
}
......
......@@ -99,7 +99,7 @@ impl ResourcesBuilder {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidRequestMemory(error).into()),
merge_errors(self.errors, FieldError::RequestMemory(error).into()),
),
}
}
......@@ -119,7 +119,7 @@ impl ResourcesBuilder {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidRequestCpu(error).into()),
merge_errors(self.errors, FieldError::RequestCpu(error).into()),
),
}
}
......@@ -139,7 +139,7 @@ impl ResourcesBuilder {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidLimitMemory(error).into()),
merge_errors(self.errors, FieldError::LimitMemory(error).into()),
),
}
}
......@@ -159,7 +159,7 @@ impl ResourcesBuilder {
),
Err(error) => Self::transition(
self.config,
merge_errors(self.errors, FieldError::InvalidLimitCpu(error).into()),
merge_errors(self.errors, FieldError::LimitCpu(error).into()),
),
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment