fix: use write_all

This commit is contained in:
Derrick Hammer 2024-02-18 02:25:13 -05:00
parent 0873dee1f3
commit bff0981731
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ impl Bao for BaoService {
let state = self.state.read().await; let state = self.state.read().await;
let encoder = state.hashers.get(&id).ok_or_else(|| Status::not_found("hasher not found"))?.clone(); let encoder = state.hashers.get(&id).ok_or_else(|| Status::not_found("hasher not found"))?.clone();
let mut encoder = encoder.lock().await; let mut encoder = encoder.lock().await;
encoder.write(&request.get_ref().data).map_err(|_| Status::internal("write failed"))?; encoder.write_all(&request.get_ref().data).map_err(|_| Status::internal("write failed"))?;
} }
Ok(Response::new(HashResponse { Ok(Response::new(HashResponse {
status: true, status: true,