Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
fix: slice cloning on TokioI18nBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
nashiradeer committed Jun 10, 2024
1 parent e67e813 commit 4c4225f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/builders/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ impl TokioI18nBuilder {

self.add_link(language, link_content).await;
} else {

let mut buffer = Vec::from(slice);

let json = spawn_blocking(move || parse_from_slice(&mut buffer)).await.map_err(Error::Tokio)??;
let json = spawn_blocking(move || parse_from_slice(&mut slice)).await.map_err(Error::Tokio)??;

self.add_language(language, json).await;
}
Expand Down

0 comments on commit 4c4225f

Please sign in to comment.