Whenever I look at mess that is python packaging, my "just hack it together in python" quickly become, "damn I should of wrote this in Rust or Go"
=> More informations about this toot | More toots from k3fnb@mastodon.radio
I deleted the python package and made a crate in anger.
I was attempting to package up some Python code that I hacked together to convert Chirp CSV to the RT3S CPS's format and to the CSV format that the UV Pro's HT uses.
After porting that code to Rust's serde library, I'm never using pydantic again. serde is so much better thought out.
=> More informations about this toot | More toots from k3fnb@mastodon.radio
I did some fun things with Rust's From trait. I wrote Hz, MegaHz, and KiloHz wrappers around the decimal crate's type.
The Chirp's csv uses MHz for the freq and the UV Pro csv uses Hz for its frequency. Because I implement From for Hz, I just need to do:
uvpro.freq = chirp.freq.into()
And Rust figures out how to convert KiloHz into Hz for me.
=> More informations about this toot | More toots from k3fnb@mastodon.radio
I'll post the code when I'm done with it. I had fun abusing the From and Into traits for mapping csv rows from one format to the other.
=> More informations about this toot | More toots from k3fnb@mastodon.radio This content has been proxied by September (3851b).Proxy Information
text/gemini