Skip to content

Commit

Permalink
feat: add with_capacity for content (#671)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Aug 15, 2024
1 parent 9ecc4d2 commit 94952ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ members = [
]

[workspace.package]
version = "0.1.100"
version = "0.1.101"
authors = ["The Dragonfly Developers"]
homepage = "https://d7y.io/"
repository = "https://github.com/dragonflyoss/client.git"
Expand All @@ -22,13 +22,13 @@ readme = "README.md"
edition = "2021"

[workspace.dependencies]
dragonfly-client = { path = "dragonfly-client", version = "0.1.100" }
dragonfly-client-core = { path = "dragonfly-client-core", version = "0.1.100" }
dragonfly-client-config = { path = "dragonfly-client-config", version = "0.1.100" }
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.1.100" }
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.100" }
dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.100" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.100" }
dragonfly-client = { path = "dragonfly-client", version = "0.1.101" }
dragonfly-client-core = { path = "dragonfly-client-core", version = "0.1.101" }
dragonfly-client-config = { path = "dragonfly-client-config", version = "0.1.101" }
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.1.101" }
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.101" }
dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.101" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.101" }
thiserror = "1.0"
dragonfly-api = "2.0.148"
reqwest = { version = "0.12.4", features = ["stream", "native-tls", "default-tls", "rustls-tls"] }
Expand Down
2 changes: 1 addition & 1 deletion dragonfly-client/src/grpc/dfdaemon_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ impl DfdaemonUpload for DfdaemonUploadServerHandler {
})?;

// Read the content of the piece.
let mut content = Vec::new();
let mut content = Vec::with_capacity(piece.length as usize);
reader.read_to_end(&mut content).await.map_err(|err| {
// Collect upload piece failure metrics.
collect_upload_piece_failure_metrics();
Expand Down

0 comments on commit 94952ae

Please sign in to comment.