From f44caa5f040ec74fac6c54ebd7493c452aadc3c9 Mon Sep 17 00:00:00 2001 From: keepsimple1 Date: Fri, 8 Apr 2022 00:11:24 -0700 Subject: [PATCH] fix doc for encode (#433) Signed-off-by: Han Xu --- src/encoder/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs index f38ad544..47cacd5d 100644 --- a/src/encoder/mod.rs +++ b/src/encoder/mod.rs @@ -16,12 +16,11 @@ use crate::proto::MetricFamily; /// An interface for encoding metric families into an underlying wire protocol. pub trait Encoder { /// `encode` converts a slice of MetricFamily proto messages into target - /// format and writes the resulting lines to `writer`. It returns the number - /// of bytes written and any error encountered. This function does not - /// perform checks on the content of the metric and label names, - /// i.e. invalid metric or label names will result in invalid text format + /// format and writes the resulting lines to `writer`. This function does not + /// perform checks on the content of the metrics and label names, + /// i.e. invalid metrics or label names will result in invalid text format /// output. - fn encode(&self, _: &[MetricFamily], _: &mut W) -> Result<()>; + fn encode(&self, mfs: &[MetricFamily], writer: &mut W) -> Result<()>; /// `format_type` returns target format. fn format_type(&self) -> &str;