Skip to content

Commit

Permalink
Reformat code and release as 0.93.1
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Egger <[email protected]>
  • Loading branch information
therealprof committed Sep 24, 2024
1 parent 4568413 commit 8991248
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "BSD-3-Clause"
name = "rusp"
readme = "README.md"
repository = "https://github.com/axiros/rusp"
version = "0.93.0"
version = "0.93.1"

[badges]
[badges.travis-ci]
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ impl AddOperationStatus {
},
})
.collect(),
unique_keys: s
.unique_keys
.into_iter()
.collect(),
unique_keys: s.unique_keys.into_iter().collect(),
}),
}),
Self::None => Err(anyhow::anyhow!("")),
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ impl DeletedObjectResultsBuilder {
}),
}),
DeleteRespOperationStatus::Failure { err_code, err_msg } => Some(OperationStatus {
oper_status: oper_failure(OperationFailure {
err_code,
err_msg,
}),
oper_status: oper_failure(OperationFailure { err_code, err_msg }),
}),
DeleteRespOperationStatus::None => Err(anyhow::anyhow!(""))?,
},
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ impl ResolvedPathResultBuilder {
}

pub fn build(self) -> Result<ResolvedPathResult> {
let result_params = self
.result_params
.into_iter()
.collect();
let result_params = self.result_params.into_iter().collect();

Ok(ResolvedPathResult {
resolved_path: self.resolved_path,
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/getinstances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ impl CurrInstanceBuilder {
}

pub fn build(self) -> Result<CurrInstance> {
let unique_keys = self
.unique_keys
.into_iter()
.collect();
let unique_keys = self.unique_keys.into_iter().collect();

Ok(CurrInstance {
instantiated_obj_path: self.instantiated_obj_path,
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ impl MsgBuilder {
};

Ok(Msg {
header: Some(Header {
msg_id,
msg_type,
}),
header: Some(Header { msg_id, msg_type }),
body: Some(body),
})
}
Expand Down
16 changes: 4 additions & 12 deletions src/usp_builder/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,16 @@ impl NotifyBuilder {
} => event(Event {
obj_path,
event_name,
params: params
.into_iter()
.collect::<HashMap<_, _>>(),
params: params.into_iter().collect::<HashMap<_, _>>(),
}),
NotifyType::ObjectCreation {
obj_path,
unique_keys,
} => obj_creation(ObjectCreation {
obj_path,
unique_keys: unique_keys
.into_iter()
.collect::<HashMap<_, _>>(),
}),
NotifyType::ObjectDeletion { obj_path } => obj_deletion(ObjectDeletion {
obj_path,
unique_keys: unique_keys.into_iter().collect::<HashMap<_, _>>(),
}),
NotifyType::ObjectDeletion { obj_path } => obj_deletion(ObjectDeletion { obj_path }),
NotifyType::OperationComplete {
obj_path,
command_name,
Expand All @@ -256,9 +250,7 @@ impl NotifyBuilder {
operation_resp: match operation_resp {
OperationCompleteType::OutputArgs(h) => OneOfoperation_resp::req_output_args(
crate::usp::mod_Notify::mod_OperationComplete::OutputArgs {
output_args: h
.into_iter()
.collect::<HashMap<_, _>>(),
output_args: h.into_iter().collect::<HashMap<_, _>>(),
},
),
OperationCompleteType::CommandFailure(code, msg) => {
Expand Down
9 changes: 2 additions & 7 deletions src/usp_builder/operate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ impl OperateBuilder {
command: self.command,
command_key: self.command_key,
send_resp: self.send_resp,
input_args: self
.input_args
.into_iter()
.collect(),
input_args: self.input_args.into_iter().collect(),
}
}),
}
Expand Down Expand Up @@ -128,9 +125,7 @@ impl OperateRespResultBuilder {
match self.operation_result {
OperateRespOperationResult::OutputArgs { output_args } => Ok(OperationResult {
operation_resp: OneOfoperation_resp::req_output_args(OutputArgs {
output_args: output_args
.into_iter()
.collect::<HashMap<_, _>>(),
output_args: output_args.into_iter().collect::<HashMap<_, _>>(),
}),
executed_command: self.executed_command,
}),
Expand Down
4 changes: 1 addition & 3 deletions src/usp_builder/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ impl SessionContextBuilder {
payload_sar_state: PayloadSARState::NONE,
// FIXME
payloadrec_sar_state: PayloadSARState::NONE,
payload: self
.payload
.map_or_else(Vec::new, |payload| vec![payload]),
payload: self.payload.map_or_else(Vec::new, |payload| vec![payload]),
};

Ok(scr)
Expand Down
5 changes: 1 addition & 4 deletions src/usp_builder/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,7 @@ impl SetOperationStatus {
},
})
.collect(),
updated_params: s
.updated_params
.into_iter()
.collect(),
updated_params: s.updated_params.into_iter().collect(),
})
.collect(),
}),
Expand Down

0 comments on commit 8991248

Please sign in to comment.