lib/avromatic/io/datum_writer.rb in avromatic-3.0.2 vs lib/avromatic/io/datum_writer.rb in avromatic-4.0.0
- old
+ new
@@ -19,12 +19,10 @@
index_of_schema = writers_schema.schemas.find_index do |schema|
Avro::Schema.validate(schema, datum)
end
end
- unless index_of_schema
- raise Avro::IO::AvroTypeError.new(writers_schema, datum)
- end
+ raise Avro::IO::AvroTypeError.new(writers_schema, datum) unless index_of_schema
encoder.write_long(index_of_schema)
write_data(writers_schema.schemas[index_of_schema], datum, encoder)
end
end