Skip to content

Commit cdf2fe3

Browse files
committed
fix: chedck error
Mutable static variables are discouraged. I guess we should move them to the proxy service. We wanted to avoid generating the error images every time we need them becuase it's costly. I would created them when the proxy service is instanciated or maybe we can create a new service with static content for the proxy.
1 parent 5e0226d commit cdf2fe3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ui/proxy.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ pub fn load_error_images() {
3232
});
3333
}
3434

35+
#[allow(static_mut_refs)]
3536
pub fn map_error_to_image(error: &Error) -> Bytes {
37+
// todo: remove "#[allow(static_mut_refs)]" attribute by assigning a owner
38+
// to the static mutable variables ERROR_IMAGE_*. Maybe the proxy service.
39+
3640
load_error_images();
3741
unsafe {
3842
match error {

0 commit comments

Comments
 (0)