@@ -117,7 +117,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
117117 examples : example. into_iter ( ) . collect :: < Vec < _ > > ( ) ,
118118 } ;
119119
120- let metadata = Some ( Box :: new ( metadata) ) . reduce ( ) ;
120+ let metadata = Some ( Box :: new ( metadata) ) . simplify_default ( ) ;
121121 let extensions = extensions. into_iter ( ) . collect ( ) ;
122122
123123 match & self . schema_kind {
@@ -137,7 +137,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
137137 min_length : min_length. convert ( ) ,
138138 pattern : pattern. clone ( ) ,
139139 } ) )
140- . reduce ( ) ,
140+ . simplify_default ( ) ,
141141 extensions,
142142 ..Default :: default ( )
143143 } ,
@@ -170,7 +170,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
170170 minimum,
171171 exclusive_minimum,
172172 } ) )
173- . reduce ( ) ,
173+ . simplify_default ( ) ,
174174 extensions,
175175 ..Default :: default ( )
176176 }
@@ -207,7 +207,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
207207 minimum,
208208 exclusive_minimum,
209209 } ) )
210- . reduce ( ) ,
210+ . simplify_default ( ) ,
211211 extensions,
212212 ..Default :: default ( )
213213 }
@@ -231,7 +231,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
231231 additional_properties : additional_properties. convert ( ) ,
232232 property_names : None ,
233233 } ) )
234- . reduce ( ) ,
234+ . simplify_default ( ) ,
235235 extensions,
236236 ..Default :: default ( )
237237 } ,
@@ -254,7 +254,7 @@ impl Convert<schemars::schema::Schema> for openapiv3::Schema {
254254 unique_items : if * unique_items { Some ( true ) } else { None } ,
255255 contains : None ,
256256 } ) )
257- . reduce ( ) ,
257+ . simplify_default ( ) ,
258258 extensions,
259259 ..Default :: default ( )
260260 } ,
@@ -797,16 +797,16 @@ impl Convert<schemars::schema::Schema> for openapiv3::AdditionalProperties {
797797 }
798798}
799799
800- trait OptionReduce {
801- fn reduce ( self ) -> Self ;
800+ trait OptionSimplifyDefault {
801+ fn simplify_default ( self ) -> Self ;
802802}
803803
804804// If an Option is `Some` of it's default value, we can simplify that to `None`
805- impl < T > OptionReduce for Option < T >
805+ impl < T > OptionSimplifyDefault for Option < T >
806806where
807807 T : Default + PartialEq + std:: fmt:: Debug ,
808808{
809- fn reduce ( self ) -> Self {
809+ fn simplify_default ( self ) -> Self {
810810 match & self {
811811 Some ( s) if s != & T :: default ( ) => self ,
812812 _ => None ,
0 commit comments