Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Error {
- InvalidLoginOrPassword,
- Other,
- }
- struct Status {
- code: i32
- }
- impl Status {
- fn ok() -> Status {
- Status {
- code: 200,
- }
- }
- }
- struct LoginForm(Status);
- struct UpdateUserForm(Status);
- // etc...
- fn login<'a>(_username: &'a str, _password: &'a str) -> Result<LoginForm, Error> {
- Ok(LoginForm(Status::ok()))
- }
- fn main() {
- login("Username", "Password");
- }
Add Comment
Please, Sign In to add comment