[PR #3] [MERGED] Some minor changes on the PR #584

Closed
opened 2026-05-22 23:58:42 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/mpd-discord-rpc/pull/3
Author: @simvux
Created: 3/13/2020
Status: Merged
Merged: 3/13/2020
Merged by: @JakeStanger

Base: feat/formatting-configHead: feat/formatting-config


📝 Commits (3)

  • 7d0cc25 Fancier error handling in that match statement
  • e94b5de static -> const
  • 7f92219 Removed some unessesarry references

📊 Changes

1 file changed (+22 additions, -23 deletions)

View changed files

📝 src/main.rs (+22 -23)

📄 Description

In general you should also use toml::from_str onto a struct you create which matches your toml config, this would have many times better performance than the dynamic runtime parsing you're doing now at the first few lines of main.rs. However this would be a much larger change so I'm leaving that up to you.

Would also be good to create a struct which contains your state, then creating methods for that struct. Instead of just using loose variables. But this is also a larger change so I'm skipping that for now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/mpd-discord-rpc/pull/3 **Author:** [@simvux](https://github.com/simvux) **Created:** 3/13/2020 **Status:** ✅ Merged **Merged:** 3/13/2020 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `feat/formatting-config` ← **Head:** `feat/formatting-config` --- ### 📝 Commits (3) - [`7d0cc25`](https://github.com/JakeStanger/mpd-discord-rpc/commit/7d0cc25262acad74f16d1087fc451545a1113c58) Fancier error handling in that match statement - [`e94b5de`](https://github.com/JakeStanger/mpd-discord-rpc/commit/e94b5de02c1b477548a44a64a201f0ef5f781af5) static -> const - [`7f92219`](https://github.com/JakeStanger/mpd-discord-rpc/commit/7f922195cbe3706d919f474783fda789a4bccf52) Removed some unessesarry references ### 📊 Changes **1 file changed** (+22 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `src/main.rs` (+22 -23) </details> ### 📄 Description In general you should also use [toml::from_str onto a struct you create which matches your toml config](https://github.com/alexcrichton/toml-rs/blob/master/examples/decode.rs), this would have many times better performance than the dynamic runtime parsing you're doing now at the first few lines of main.rs. However this would be a much larger change so I'm leaving that up to you. Would also be good to create a struct which contains your state, then creating methods for that struct. Instead of just using loose variables. But this is also a larger change so I'm skipping that for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-22 23:58:42 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/mpd-discord-rpc#584
No description provided.