Major post-refactor cleanup
parent: tbd commit: f90d7fb
1 | use Error; |
2 | |
3 | use crate:: |
4 | |
5 | UserBioRequest, UserDisplayImageRequest, UserDisplayNameRequest, UserRepositoriesRequest, |
6 | UserRepositoriesResponse, |
7 | , |
8 | , |
9 | ; |
10 | |
11 | use ; |
12 | |
13 | pub async |
14 | if display_name.handle_message .await.is_ok |
15 | Ok |
16 | else if display_image.handle_message .await.is_ok |
17 | Ok |
18 | else if bio.handle_message .await.is_ok |
19 | Ok |
20 | else if repositories.handle_message .await.is_ok |
21 | Ok |
22 | else |
23 | Err |
24 | |
25 | |
26 | |
27 | async |
28 | Message | : ,
29 | State | : ,
30 | |
31 | let mut user_backend = connection_state.user_backend.lock .await; |
32 | let response = user_backend.display_name .await?; |
33 | |
34 | drop; |
35 | |
36 | connection_state.send .await?; |
37 | |
38 | Ok |
39 | |
40 | |
41 | async |
42 | Message | : ,
43 | State | : ,
44 | |
45 | let mut user_backend = connection_state.user_backend.lock .await; |
46 | let response = user_backend.display_image .await?; |
47 | |
48 | drop; |
49 | |
50 | connection_state.send .await?; |
51 | |
52 | Ok |
53 | |
54 | |
55 | async |
56 | Message | : ,
57 | State | : ,
58 | |
59 | let mut user_backend = connection_state.user_backend.lock .await; |
60 | let response = user_backend.bio .await?; |
61 | |
62 | drop; |
63 | |
64 | connection_state.send .await?; |
65 | |
66 | Ok |
67 | |
68 | |
69 | async |
70 | Message | : ,
71 | State | : ,
72 | |
73 | let mut repository_backend = connection_state.repository_backend.lock .await; |
74 | |
75 | let repositories = repository_backend |
76 | .repositories_for_user |
77 | .await; |
78 | |
79 | let repositories = match repositories |
80 | Ok => repositories, |
81 | Err => |
82 | error!; |
83 | return Ok; |
84 | |
85 | ; |
86 | drop; |
87 | |
88 | let mut user_backend = connection_state.user_backend.lock .await; |
89 | let user_exists = user_backend.exists .await; |
90 | |
91 | if repositories.is_empty && !matches! |
92 | panic! |
93 | |
94 | |
95 | let response: UserRepositoriesResponse = UserRepositoriesResponse ; |
96 | |
97 | connection_state.send .await?; |
98 | |
99 | Ok |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | Other, |
106 | |
107 |