Refactor/maccel_core::params::persist -> maccel_core::persist#77
Refactor/maccel_core::params::persist -> maccel_core::persist#77Gnarus-G merged 6 commits intoGnarus-G:mainfrom
maccel_core::params::persist -> maccel_core::persist#77Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
There are still some compilation errors currently, otherwise LGTM. When you fix those I'll merge. |
|
Oops, looks like a last-minute addition slipped past my LSP. On it! To document, my latest commit makes the following additional change:
|
|
All tests passed! I really skipped everything test-related when I was learning Rust, I shouldn't have done that. TIL. Oh and uhh... - use maccel_core::{fixedptc::Fpt, ContextRef, Parameter};
+ use maccel_core::{ContextRef, Parameter, fixedptc::Fpt};I may have inadvertently messed up a few import orders... I blame my auto-formatter. Should I revert all of these? |
|
One more thing, remove that "BREAKING CHANGE" prefix from the commit message on BREAKING CHANGE: Refactor trait ParamStore for consistent error handling and ref self |
Order is not that important to me, what the formatter does is fine. I might add |
|
The BREAKING CHANGE: is from Conventional Commits, but whatever you say is king. I'll rebase and force push in a jiffy. |
517ed35 to
d643628
Compare
|
Done. |
Ain't nobody got time for all these different conventions. But it does look like they recommended putting that in the body/footer of the commit, not the subject line. I'm generally down with putting whatever in the body. |
|
Thank you thank you thank you! This happens to be my first successful PR, like, ever! This was such a pleasing experience, and I'm happy to be along in the ride. |
I'm very happy to be the one to merge your first ever PR. |
This PR includes BREAKING CHANGES. Though I doubt anyone but myself uses
maccel_coreseparately.As you may be aware,
maccel_core::params::persistmainly houses definitions forParamStoreandSysFsStore, a trait for defining behaviour when retrieving and modifying parameters. However the modulepersistseems to bear no more similarity toparamsthan, say,context, whileparams.rsis quite sizable and a split may be desirable.At the same time, while I was using
maccel_corein my sy3c4ll/maccel-gui I noticed quirks and inconsistencies with regards topersist::ParamStore, namely that whilegetandsettook inself,get_current_accel_modeandset_current_accel_modedid not while also panicking on error instead of returning ananyhow::Result. This introduced difficulties where I couldn't handle mode switching errors, nor save the mode as a member variable in testing.This PR addresses these issues.
pub mod persistincrates/core/src/params.rsinto its owncrates/core/src/persist.rsmod validateincrates/core/src/params.rsand extract contents toparams.rswhile I'm at it, since the module housed only one function which was only necessary for a mysteriousDisplayimpl forFptinpersist.rs...?trait ParamStoreinpersist.rsas describedI've ensured it works for crates
cliandtuialready, there should be no problems there.RSVP.