Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

refactor/response: add Request::error_response and simplify Response variants #83

Merged
merged 2 commits into from Aug 1, 2019

Conversation

mrcnski
Copy link
Contributor

@mrcnski mrcnski commented Jul 23, 2019

No description provided.

ListAuthKeysAndVersion => Response::ListAuthKeysAndVersion(Err(error)),
InsAuthKey { .. } => Response::Mutation(Err(error)),
DelAuthKey { .. } => Response::Mutation(Err(error)),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can reduce the amount of code here a bit by grouping all the requests that map to Response::Mutation:

Request::PutIData(_)
    | Request::DeleteUnpubIData(_)
    ...
    | Request::DelAuthKey { .. } => Response::Mutation(Err(error)),

@mrcnski mrcnski force-pushed the error-response branch 2 times, most recently from 8ea72f7 to 39fe1fb Compare July 31, 2019 11:26
madadam
madadam previously approved these changes Jul 31, 2019
From the Rust docs:

> Only implement Into if a conversion to a type outside the current crate is required. From cannot do these type of conversions because of Rust's orphaning rules.
@nbaksalyar nbaksalyar merged commit 3f73ac5 into maidsafe:master Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants