Commit efb51fb
authored
refactor(meta): minor structural cleanups in process, control, admin, semaphore (#19470)
Fix 5 code quality items identified in the meta crate review:
- process/kv_processor.rs: replace `unreachable!()` with `debug_assert!()` to
avoid panics in release builds; `unreachable!` should be used only when the
compiler cannot prove a code path is impossible.
- process/process_meta_dir.rs: move the unused `v1_ent` suppression into the
destructuring pattern (`_v1_ent`) instead of a separate `let _ = v1_ent`
binding.
- control/export_from_grpc.rs: replace `is_some() + unwrap()` with
`if let Some(ref mut f)`, eliminating redundant borrows.
- plugins/semaphore/semaphore.rs: initialize `seq_policy` directly with
`GeneratorKey` instead of first setting `TimeBased` then overwriting it.
- admin/v1/ctrl.rs: add a local `internal_err` helper (matching the one in
`features.rs`) and replace the three verbose
`map_err(|e| poem::Error::from_string(e.to_string(), INTERNAL_SERVER_ERROR))`
chains with `.map_err(internal_err)`.1 parent f489dfc commit efb51fb
File tree
5 files changed
+28
-37
lines changed- src/meta
- admin/src/v1
- control/src
- plugins/semaphore/src
- process/src
5 files changed
+28
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 47 | + | |
| 48 | + | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 59 | + | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
| |||
116 | 110 | | |
117 | 111 | | |
118 | 112 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 113 | + | |
| 114 | + | |
125 | 115 | | |
126 | 116 | | |
127 | 117 | | |
| |||
131 | 121 | | |
132 | 122 | | |
133 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 120 | + | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | 124 | | |
127 | | - | |
128 | | - | |
| 125 | + | |
| 126 | + | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
| 167 | + | |
| 168 | + | |
170 | 169 | | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 179 | | |
185 | 180 | | |
186 | 181 | | |
| |||
326 | 321 | | |
327 | 322 | | |
328 | 323 | | |
329 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
330 | 329 | | |
331 | 330 | | |
332 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
0 commit comments