From cb5c901066d88e5ad70321ed7b98956312ab3248 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Fri, 21 Jan 2022 09:43:48 -0800 Subject: [PATCH] fix doc for encode 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;