martin-g commented on code in PR #423:
URL: https://github.com/apache/avro-rs/pull/423#discussion_r2718547459


##########
avro/src/schema/record/schema.rs:
##########
@@ -90,11 +90,14 @@ mod tests {
 
         let record_schema = RecordSchema::builder()
             .name(name.clone())
-            .aliases(Some(vec!["alias_1".into()]))
+            .aliases(Some(vec!["alias_1".try_into().expect("Alias is valid")]))

Review Comment:
   Can we have them both ?
   This very first diff chunk easily convinces me that the From impl is very 
useful for such usages where the user is certain that it won't fail.
   
   We just have to explain well in the rustdoc that if the string comes from 
user input and there is a chance that it may be invalid Name then TryFrom 
should be used.
   
   WDYT ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to