Skip to content

Commit f89ff97

Browse files
committed
Quick adjustments
* Move example description to a module comment * Remove trait bound
1 parent f58d49c commit f89ff97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/io_write.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//! Example showing how one could write to a file or socket instead of a string.
2+
//! For large metrics registries this will be more memory efficient.
3+
14
use prometheus_client::{encoding::text::encode, metrics::counter::Counter, registry::Registry};
25
use std::io::Write;
36

4-
/// Example showing how one could write to a file or socket instead of a string.
5-
/// For large metrics registries this will be more memory efficient
67
fn main() {
78
let mut registry = <Registry>::with_prefix("stream");
89
let request_counter: Counter<u64> = Default::default();
@@ -23,9 +24,7 @@ fn main() {
2324
assert!(buf.as_bytes() == file);
2425
}
2526

26-
pub struct IoWriterWrapper<W>(W)
27-
where
28-
W: Write;
27+
pub struct IoWriterWrapper<W>(W);
2928

3029
impl<W> std::fmt::Write for IoWriterWrapper<W>
3130
where

0 commit comments

Comments
 (0)