stanislav-tkach / os_info

Rust library to detect the operating system type
MIT License
175 stars 52 forks source link

Update os_type.rs , enum can be as u8 . Unknown place first, and it will be the number 0. I think it is appropriate to use 0 to identify unknown systems. #296

Closed gcxfd closed 1 year ago

gcxfd commented 2 years ago

I want to use u8 to record what system it is, enum can be as u8 . Unknown is placed first, and it will be the number 0. I think it is appropriate to use 0 to identify unknown systems. In addition, I hope that when additional operating systems are added in the future, the ordering of the existing systems in the enum will not be changed.

stanislav-tkach commented 2 years ago

Could you please tell me more about your use case? Are you want to serialize and store this enum, so variant reordering would be an issue? I think that preserving ordering can make sense in that case, but previously there was no such guarantee.