Closed carlocorradini closed 8 months ago
Provide the following implementations for dis_rs::model::EntityType:
dis_rs::model::EntityType
std::str::FromStr
core::convert::TryFrom<&str>
core::convert::TryFrom<String>
std::fmt::Display
Examples:
let entity_type: dis_rs::model::EntityType = dis_rs::model::EntityType::from_str("0:1:2:3:4:5:6").unwrap(); let entity_type: dis_rs::model::EntityType = "0:1:2:3:4:5:6".try_into().unwrap(); let entity_type: dis_rs::model::EntityType = "0:1:2:3:4:5:6".to_string().try_into().unwrap(); println!("{entity_type}"); // 0:1:2:3:4:5:6
I'll try to provide a PR ASAP. Let me know what you think.
Those would be very logical and useful trait implementations.
Thanks!
@zlubsen Thanks! Awesome library 🤯
Provide the following implementations for
dis_rs::model::EntityType
:std::str::FromStr
core::convert::TryFrom<&str>
core::convert::TryFrom<String>
std::fmt::Display
Examples:
I'll try to provide a PR ASAP. Let me know what you think.