Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Improved API to create field.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Nov 28, 2021
1 parent 35dfab3 commit b556fcb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/datatypes/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ impl PartialEq for Field {
}

impl Field {
/// Creates a new field
pub fn new(name: &str, data_type: DataType, nullable: bool) -> Self {
/// Creates a new [`Field`].
pub fn new<T: Into<String>>(name: T, data_type: DataType, nullable: bool) -> Self {
Field {
name: name.to_string(),
name: name.into(),
data_type,
nullable,
dict_id: 0,
Expand All @@ -73,15 +73,15 @@ impl Field {
}

/// Creates a new field
pub fn new_dict(
name: &str,
pub fn new_dict<T: Into<String>>(
name: T,
data_type: DataType,
nullable: bool,
dict_id: i64,
dict_is_ordered: bool,
) -> Self {
Field {
name: name.to_string(),
name: name.into(),
data_type,
nullable,
dict_id,
Expand Down

0 comments on commit b556fcb

Please sign in to comment.