Skip to content

Conversation

@null8626
Copy link
Contributor

@null8626 null8626 commented Jan 13, 2026

The following pull request applies the following changes for optimization purposes:

  • Refactor crate::utils::emojis::get_emoji by making the second argument a &str not a String and making the function a one-liner
  • .await several unused async calls
  • Refactor several uses of format!() and including removing some redundant ones
  • Prevent redundant clone()ing of Option<T> types by using as_ref() or as_deref() instead
  • Prevent redundant clone()ing of types that implement Copy
  • Collapse several nested if-statements
  • Use unwrap_or_default() whenever necessary
  • Remove several redundant uses of Arc<T>s
  • And finally specifically for FilterPreset:
    • Use an array constant ALL instead of a method returns the same Vec<T> every time
    • Use a custom equalizer_vec![] macro for every equalizer bands declaration instead of creating a Vec and reconstructing it every time
    • Refactor several methods that matches against itself (using Self, marking some of them as const, etc.)
    • Adding a FromStr impl to make outside code that use it cleaner
    • Use the Filters { ..., ..Default::default() } instead of manually modifying a manually created Filters struct

@magmabits
Copy link

this is code

@null8626
Copy link
Contributor Author

yes, this is indeed code!

@notigorwastaken notigorwastaken self-requested a review January 13, 2026 18:44
@notigorwastaken
Copy link
Collaborator

Seeing these corrections made me realize I'm a terrible programmer lol

Copy link
Collaborator

@notigorwastaken notigorwastaken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution, welcome to the team. 🥰

@notigorwastaken notigorwastaken merged commit 0cfb03e into OnBeat-Project:main Jan 13, 2026
2 checks passed
@null8626
Copy link
Contributor Author

Seeing these corrections made me realize I'm a terrible programmer lol

No, you are not! You are learning, Igor! To be honest, I would even say your Rust code is pretty good! ❤️

@null8626
Copy link
Contributor Author

Just be sure to take note of my suggestions as you learn along! 😉

@notigorwastaken
Copy link
Collaborator

Just be sure to take note of my suggestions as you learn along! 😉

Absolutely, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants