Skip to content

Commit

Permalink
chore(clippy): Clippy fix for unnecessary as_bytes() on a string
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Jan 10, 2025
1 parent 834a15c commit ccf4114
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/src/http/unleash_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ mod tests {
fn expected_etag(features: ClientFeatures) -> String {
let hash = features.xx3_hash().unwrap();
let len = serde_json::to_string(&features)
.map(|string| string.as_bytes().len())
.map(|string| string.len())
.unwrap();
format!("{len:x}-{hash}")
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/metrics/client_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub struct MetricsCache {

pub(crate) fn size_of_batch(batch: &MetricsBatch) -> usize {
serde_json::to_string(batch)
.map(|s| s.as_bytes().len())
.map(|s| s.len())
.unwrap_or(0)
}

Expand Down

0 comments on commit ccf4114

Please sign in to comment.