style(table-engine): Remove unnecessary TableError::from (#312)

The usage of TableError::from could be replaced by `?`, which is more
concise
This commit is contained in:
evenyag
2022-10-17 11:49:21 +08:00
committed by GitHub
parent 25a16875b6
commit f942b53ed0

View File

@@ -100,7 +100,7 @@ impl<R: Region> Table for MitoTable<R> {
.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<R: Region> Table for MitoTable<R> {
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()?;
}
}