@@ -157,49 +157,48 @@ pub trait TypeOptionCellWriter {
157157 /// into [Cell]
158158 fn convert_json_to_cell ( & self , json_value : serde_json:: Value ) -> Cell ;
159159}
160-
161160pub fn type_option_cell_writer (
162161 type_option_data : TypeOptionData ,
163162 field_type : & FieldType ,
164- ) -> Option < Box < dyn TypeOptionCellWriter > > {
163+ ) -> Box < dyn TypeOptionCellWriter > {
165164 match field_type {
166- FieldType :: RichText => Some ( Box :: new ( RichTextTypeOption :: from ( type_option_data) ) ) ,
167- FieldType :: Number => Some ( Box :: new ( NumberTypeOption :: from ( type_option_data) ) ) ,
168- FieldType :: DateTime => Some ( Box :: new ( DateTypeOption :: from ( type_option_data) ) ) ,
169- FieldType :: SingleSelect => Some ( Box :: new ( SingleSelectTypeOption :: from ( type_option_data) ) ) ,
170- FieldType :: MultiSelect => Some ( Box :: new ( MultiSelectTypeOption :: from ( type_option_data) ) ) ,
171- FieldType :: Checkbox => Some ( Box :: new ( CheckboxTypeOption :: from ( type_option_data) ) ) ,
172- FieldType :: URL => Some ( Box :: new ( URLTypeOption :: from ( type_option_data) ) ) ,
173- FieldType :: Time => Some ( Box :: new ( TimeTypeOption :: from ( type_option_data) ) ) ,
174- FieldType :: Media => Some ( Box :: new ( MediaTypeOption :: from ( type_option_data) ) ) ,
175- FieldType :: Checklist => Some ( Box :: new ( ChecklistTypeOption :: from ( type_option_data) ) ) ,
176- FieldType :: LastEditedTime => Some ( Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ) ,
177- FieldType :: CreatedTime => Some ( Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ) ,
178- FieldType :: Relation => Some ( Box :: new ( RelationTypeOption :: from ( type_option_data) ) ) ,
179- FieldType :: Summary => Some ( Box :: new ( SummarizationTypeOption :: from ( type_option_data) ) ) ,
180- FieldType :: Translate => Some ( Box :: new ( TranslateTypeOption :: from ( type_option_data) ) ) ,
165+ FieldType :: RichText => Box :: new ( RichTextTypeOption :: from ( type_option_data) ) ,
166+ FieldType :: Number => Box :: new ( NumberTypeOption :: from ( type_option_data) ) ,
167+ FieldType :: DateTime => Box :: new ( DateTypeOption :: from ( type_option_data) ) ,
168+ FieldType :: SingleSelect => Box :: new ( SingleSelectTypeOption :: from ( type_option_data) ) ,
169+ FieldType :: MultiSelect => Box :: new ( MultiSelectTypeOption :: from ( type_option_data) ) ,
170+ FieldType :: Checkbox => Box :: new ( CheckboxTypeOption :: from ( type_option_data) ) ,
171+ FieldType :: URL => Box :: new ( URLTypeOption :: from ( type_option_data) ) ,
172+ FieldType :: Time => Box :: new ( TimeTypeOption :: from ( type_option_data) ) ,
173+ FieldType :: Media => Box :: new ( MediaTypeOption :: from ( type_option_data) ) ,
174+ FieldType :: Checklist => Box :: new ( ChecklistTypeOption :: from ( type_option_data) ) ,
175+ FieldType :: LastEditedTime => Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ,
176+ FieldType :: CreatedTime => Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ,
177+ FieldType :: Relation => Box :: new ( RelationTypeOption :: from ( type_option_data) ) ,
178+ FieldType :: Summary => Box :: new ( SummarizationTypeOption :: from ( type_option_data) ) ,
179+ FieldType :: Translate => Box :: new ( TranslateTypeOption :: from ( type_option_data) ) ,
181180 }
182181}
183182
184183pub fn type_option_cell_reader (
185184 type_option_data : TypeOptionData ,
186185 field_type : & FieldType ,
187- ) -> Option < Box < dyn TypeOptionCellReader > > {
186+ ) -> Box < dyn TypeOptionCellReader > {
188187 match field_type {
189- FieldType :: RichText => Some ( Box :: new ( RichTextTypeOption :: from ( type_option_data) ) ) ,
190- FieldType :: Number => Some ( Box :: new ( NumberTypeOption :: from ( type_option_data) ) ) ,
191- FieldType :: DateTime => Some ( Box :: new ( DateTypeOption :: from ( type_option_data) ) ) ,
192- FieldType :: SingleSelect => Some ( Box :: new ( SingleSelectTypeOption :: from ( type_option_data) ) ) ,
193- FieldType :: MultiSelect => Some ( Box :: new ( MultiSelectTypeOption :: from ( type_option_data) ) ) ,
194- FieldType :: Checkbox => Some ( Box :: new ( CheckboxTypeOption :: from ( type_option_data) ) ) ,
195- FieldType :: URL => Some ( Box :: new ( URLTypeOption :: from ( type_option_data) ) ) ,
196- FieldType :: Time => Some ( Box :: new ( TimeTypeOption :: from ( type_option_data) ) ) ,
197- FieldType :: Media => Some ( Box :: new ( MediaTypeOption :: from ( type_option_data) ) ) ,
198- FieldType :: Checklist => Some ( Box :: new ( ChecklistTypeOption :: from ( type_option_data) ) ) ,
199- FieldType :: LastEditedTime => Some ( Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ) ,
200- FieldType :: CreatedTime => Some ( Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ) ,
201- FieldType :: Relation => Some ( Box :: new ( RelationTypeOption :: from ( type_option_data) ) ) ,
202- FieldType :: Summary => Some ( Box :: new ( SummarizationTypeOption :: from ( type_option_data) ) ) ,
203- FieldType :: Translate => Some ( Box :: new ( TranslateTypeOption :: from ( type_option_data) ) ) ,
188+ FieldType :: RichText => Box :: new ( RichTextTypeOption :: from ( type_option_data) ) ,
189+ FieldType :: Number => Box :: new ( NumberTypeOption :: from ( type_option_data) ) ,
190+ FieldType :: DateTime => Box :: new ( DateTypeOption :: from ( type_option_data) ) ,
191+ FieldType :: SingleSelect => Box :: new ( SingleSelectTypeOption :: from ( type_option_data) ) ,
192+ FieldType :: MultiSelect => Box :: new ( MultiSelectTypeOption :: from ( type_option_data) ) ,
193+ FieldType :: Checkbox => Box :: new ( CheckboxTypeOption :: from ( type_option_data) ) ,
194+ FieldType :: URL => Box :: new ( URLTypeOption :: from ( type_option_data) ) ,
195+ FieldType :: Time => Box :: new ( TimeTypeOption :: from ( type_option_data) ) ,
196+ FieldType :: Media => Box :: new ( MediaTypeOption :: from ( type_option_data) ) ,
197+ FieldType :: Checklist => Box :: new ( ChecklistTypeOption :: from ( type_option_data) ) ,
198+ FieldType :: LastEditedTime => Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ,
199+ FieldType :: CreatedTime => Box :: new ( TimestampTypeOption :: from ( type_option_data) ) ,
200+ FieldType :: Relation => Box :: new ( RelationTypeOption :: from ( type_option_data) ) ,
201+ FieldType :: Summary => Box :: new ( SummarizationTypeOption :: from ( type_option_data) ) ,
202+ FieldType :: Translate => Box :: new ( TranslateTypeOption :: from ( type_option_data) ) ,
204203 }
205204}
0 commit comments