@@ -68,8 +68,8 @@ impl InstrumentKind {
6868/// Describes properties an instrument is created with, used for filtering in
6969/// [View](crate::metrics::View)s.
7070///
71- /// A reference to `Instrument` is provided to the `view ` to select the
72- /// instrument(s) for which the [Stream] should be applied.
71+ /// Users can utilize a reference to `Instrument ` to select the instrument(s)
72+ /// for which the [Stream] should be applied.
7373///
7474/// # Example
7575///
@@ -78,7 +78,7 @@ impl InstrumentKind {
7878///
7979/// let my_view_change_cardinality = |i: &Instrument| {
8080/// if i.name() == "my_second_histogram" {
81- /// // Note: If Stream is invalid, build() will return an error. By
81+ /// // Note: If Stream is invalid, ` build()` will return an error. By
8282/// // calling `.ok()`, any such error is ignored and treated as if the
8383/// // view does not match the instrument. If this is not the desired
8484/// // behavior, consider handling the error explicitly.
@@ -185,8 +185,8 @@ impl StreamBuilder {
185185 /// Set the stream allowed attribute keys.
186186 ///
187187 /// Any attribute recorded for the stream with a key not in this set will be
188- /// dropped. If the set is empty, all attributes will be dropped, if `None` all
189- /// attributes will be kept.
188+ /// dropped. If the set is empty, all attributes will be dropped.
189+ /// If not set, all attributes will be kept.
190190 pub fn with_allowed_attribute_keys (
191191 mut self ,
192192 attribute_keys : impl IntoIterator < Item = Key > ,
@@ -256,7 +256,9 @@ fn validate_bucket_boundaries(boundaries: &[f64]) -> Result<(), String> {
256256 // validate that buckets are sorted and non-duplicate
257257 for i in 1 ..boundaries. len ( ) {
258258 if boundaries[ i] <= boundaries[ i - 1 ] {
259- return Err ( "Bucket boundaries must be sorted and non-duplicate" . to_string ( ) ) ;
259+ return Err (
260+ "Bucket boundaries must be sorted and not contain any duplicates" . to_string ( ) ,
261+ ) ;
260262 }
261263 }
262264
0 commit comments