Skip to content

Commit

Permalink
Small documentation improvements for compression middleware
Browse files Browse the repository at this point in the history
- Rewrap doc comments on CompressionLevel variants
- Normalize wording for CompressionLayer::new
  • Loading branch information
jplatte committed Feb 19, 2024
1 parent d205b1a commit 93fe516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tower-http/src/compression/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
}

impl CompressionLayer {
/// Create a new [`CompressionLayer`]
/// Creates a new [`CompressionLayer`].
pub fn new() -> Self {
Self::default()
}
Expand Down
10 changes: 7 additions & 3 deletions tower-http/src/compression_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,16 @@ pub enum CompressionLevel {
Fastest,
/// Best quality of compression, usually produces the smallest size.
Best,
/// Default quality of compression defined by the selected compression algorithm.
/// Default quality of compression defined by the selected compression
/// algorithm.
#[default]
Default,
/// Precise quality based on the underlying compression algorithms'
/// qualities. The interpretation of this depends on the algorithm chosen
/// and the specific implementation backing it.
/// qualities.
///
/// The interpretation of this depends on the algorithm chosen and the
/// specific implementation backing it.
///
/// Qualities are implicitly clamped to the algorithm's maximum.
Precise(i32),
}
Expand Down

0 comments on commit 93fe516

Please sign in to comment.