I wrote this mostly as a thing to help, and hopefully eventually replace, one of my autohotkey scripts since it doesn't have access to the windows clipboard history, and it is just a very awkward language to write anything advanced in overall.
This is my first time writing a rust program that deals with:
- async
winrt- formatting numbers
impls other thanDefault
So a review would be much appreciated. All the miscunwarps inset_clipboard_valueare so I can see if it fails with less effort.
The specific things I'm mostly wondering about are:- Is there a better way to handle the
IAsyncOperationfromGetHistoryItemsAsync, especially when combined with a time out? Or also adding a retry system? This also applies toGetTextAsync. - In
impl std::iter::Sum for Decimal, how can anything go from a[&u8]to a[&Decimal]? The library I used before did it, but I always ran into the returnedDecimalnot having a long enough life time. - Is there a more sane way to do the comma separated number formatting?
Any other miscellaneous advice is very welcome.
Thanks, here's the link https://paste.pythondiscord.com/AQFA