fresh-borzoni commented on PR #397:
URL: https://github.com/apache/fluss-rust/pull/397#issuecomment-3983469871

   @charlesdong1991 TY for the PR
   
   Small comment:
   The same match value { "round_robin" | "sticky" } now exists in 3 places 
(dict constructor, this setter, Cpp new_connection). NoKeyAssigner already 
derives ValueEnum but is missing FromStr.                                       
               
                                                                                
                                                                                
                                                                                
        
   strum is already a dep and DataLakeFormat already uses the exact pattern 
needed, we can do like this:                                                    
                                                                                
                          
      
   ```rust                                                     
     #[derive(..., EnumString, Display)]                                        
                                                                                
                                                                                
        
     #[strum(ascii_case_insensitive)]                      
     pub enum NoKeyAssigner {
         #[strum(serialize = "sticky")]
         Sticky,
         #[strum(serialize = "round_robin")]
         RoundRobin,
     }
   ```
   
   Then all 3 sites become value.parse().map_err(...) — same as the numeric 
fields. Also makes parsing case-insensitive for free.
   


-- 
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