fix: Keep ParseError's description private; use Display instead

This gives us more flexibility to refactor ParseError in the future.
pull/24376/head
Carol (Nichols || Goulding) 2020-04-02 09:07:40 -04:00
parent ac5ecb01dc
commit 38b39eb095
2 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ pub struct Pair {
#[derive(Debug, Clone)]
pub struct ParseError {
pub description: String,
description: String,
}
impl fmt::Display for ParseError {

View File

@ -264,7 +264,7 @@ async fn send_series_filters(
.db
.read_points(org_id, bucket_id, predicate, range)
.await
.map_err(|err| Status::internal(format!("error reading db: {}", err.description)))?;
.map_err(|err| Status::internal(format!("error reading db: {}", err)))?;
let mut last_frame_key = String::new();
@ -275,7 +275,7 @@ async fn send_series_filters(
if last_frame_key != batch.key {
last_frame_key = batch.key.clone();
let tags = index_pairs(&batch.key)
.map_err(|err| Status::invalid_argument(err.description))?
.map_err(|err| Status::invalid_argument(err.to_string()))?
.into_iter()
.map(|p| Tag {
key: p.key.bytes().collect(),