Skip to content

Commit

Permalink
style: simplify the code
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Apr 26, 2024
1 parent 831b19f commit 4bd503f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 1 addition & 18 deletions src/common/meta/src/ddl/alter_table/region_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use api::v1::region::{
alter_request, AddColumn, AddColumns, AlterRequest, DropColumn, DropColumns, RegionColumnDef,
RegionRequest, RegionRequestHeader,
};
use api::v1::{ChangeColumnType, ChangeColumnTypes};
use common_telemetry::tracing_context::TracingContext;
use snafu::OptionExt;
use store_api::storage::RegionId;
Expand Down Expand Up @@ -92,23 +91,7 @@ fn create_proto_alter_kind(
add_columns,
})))
}
Kind::ChangeColumnTypes(x) => {
let change_column_types = x
.change_column_types
.iter()
.map(|change_column_type| ChangeColumnType {
column_name: change_column_type.column_name.clone(),
target_type: change_column_type.target_type,
target_type_extension: change_column_type.target_type_extension.clone(),
})
.collect();

Ok(Some(alter_request::Kind::ChangeColumnTypes(
ChangeColumnTypes {
change_column_types,
},
)))
}
Kind::ChangeColumnTypes(x) => Ok(Some(alter_request::Kind::ChangeColumnTypes(x.clone()))),
Kind::DropColumns(x) => {
let drop_columns = x
.drop_columns
Expand Down
2 changes: 1 addition & 1 deletion src/store-api/src/region_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use std::collections::HashMap;
use std::fmt::{self};
use std::fmt;

use api::helper::ColumnDataTypeWrapper;
use api::v1::add_column_location::LocationType;
Expand Down

0 comments on commit 4bd503f

Please sign in to comment.