refactor(data,core): consolidate APP_DIR_NAME and add #[must_use] on pure fns
- Hoist APP_DIR_NAME = "ferrous_solitaire" to solitaire_data crate root as pub(crate); remove 5 duplicate local definitions across achievements, progress, settings, storage, replay modules (L-9) - Add #[must_use] to can_place_on_foundation, can_place_on_tableau, and is_valid_tableau_sequence in solitaire_core::rules so callers that accidentally discard the result get a compile-time warning (L-6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,12 +10,11 @@ use std::path::{Path, PathBuf};
|
||||
|
||||
pub use solitaire_sync::AchievementRecord;
|
||||
|
||||
const APP_DIR_NAME: &str = "ferrous_solitaire";
|
||||
const FILE_NAME: &str = "achievements.json";
|
||||
|
||||
/// Platform-specific default path for `achievements.json`.
|
||||
pub fn achievements_file_path() -> Option<PathBuf> {
|
||||
crate::data_dir().map(|d| d.join(APP_DIR_NAME).join(FILE_NAME))
|
||||
crate::data_dir().map(|d| d.join(crate::APP_DIR_NAME).join(FILE_NAME))
|
||||
}
|
||||
|
||||
/// Load achievements from an explicit path. Returns `Vec::new()` if the file
|
||||
|
||||
Reference in New Issue
Block a user