From f942b53ed0bb0851ef0c2c635c8536c1fdf76147 Mon Sep 17 00:00:00 2001 From: evenyag Date: Mon, 17 Oct 2022 11:49:21 +0800 Subject: [PATCH] style(table-engine): Remove unnecessary TableError::from (#312) The usage of TableError::from could be replaced by `?`, which is more concise --- src/table-engine/src/table.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/table-engine/src/table.rs b/src/table-engine/src/table.rs index 18167598c4..e05d2be875 100644 --- a/src/table-engine/src/table.rs +++ b/src/table-engine/src/table.rs @@ -100,7 +100,7 @@ impl Table for MitoTable { .add_key_column(name, vector) .map_err(TableError::new)?; } else if !column_schema.is_nullable { - return MissingColumnSnafu { name }.fail().map_err(TableError::from); + return MissingColumnSnafu { name }.fail()?; } } // Add value columns @@ -116,7 +116,7 @@ impl Table for MitoTable { if let Some(v) = vector { put_op.add_value_column(name, v).map_err(TableError::new)?; } else if !column_schema.is_nullable { - return MissingColumnSnafu { name }.fail().map_err(TableError::from); + return MissingColumnSnafu { name }.fail()?; } }