the-marenga / sf-api

Manage Shakes & Fidget characters via simple commands. Handles encryption, response parsing and everything else for you
MIT License
15 stars 3 forks source link

Macro to check whether a task is required and not completed #79

Closed alexb231 closed 3 months ago

alexb231 commented 3 months ago

Can be useful when only wanting to check for a specific task that might be required for the day that might not be done after doing the daily routines e.g playing against the gambler or attacks without a weapon, then theres no need to filter the tasks Vec. Also formatting and clippy.

the-marenga commented 3 months ago

Looks good. I am just wondering, if a get_available(&self, task_type: TaskType) -> Option<&Task> (any -> find) function would be more useful? You could still call is_some() to get the same result, or match on the result, to have immediate access to the Task in theSome(_) path to see, how much of it you are still missing.

But if you do not need that info and would like just the bool function, I can just merge this, if you want?

alexb231 commented 3 months ago

That is an interesting approach as well, for my personal use case the bool works just fine but i could implement a get available. But you are absolutely right .. i didnt think of that. There is no need to merge it, if its not useful since its your personal project :D i just personally like small helper functions.

the-marenga commented 3 months ago

Thanks!

There is no need to merge it, if its not useful since its your personal project :D i just personally like small helper functions.

Yes, I agree, small helper functions are great for usability, but I have sadly not gotten around to writing a lot of them. They are mainly just in the parts of this api that I actually use myself, so I always greatly appreciate any kind of help in improving the parts that I have neglected a bit 😄

alexb231 commented 3 months ago

Thanks!

There is no need to merge it, if its not useful since its your personal project :D i just personally like small helper functions.

Yes, I agree, small helper functions are great for usability, but I have sadly not gotten around to writing a lot of them. They are mainly just in the parts of this api that I actually use myself, so I always greatly appreciate any kind of help in improving the parts that I have neglected a bit 😄

Well you did all the heavy lifting so I understand that it had priority. Thanks for the feedback I'm just learning rust, so telling me your thoughts is actually very valuable.