Skip to content

Commit

Permalink
fix: chedck error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josecelano committed Sep 23, 2024
1 parent 5e0226d commit bc1ae77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ui/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ pub fn load_error_images() {
});
}

#[allow(static_mut_refs)]
pub fn map_error_to_image(error: &Error) -> Bytes {
// todo: remove "#[allow(static_mut_refs)]" attribute by assigning a owner
// to the static mutable variables ERROR_IMAGE_*. Maybe the proxy service.

load_error_images();
unsafe {
match error {
Expand Down

0 comments on commit bc1ae77

Please sign in to comment.