document how to add user preferences, general cleanup

This commit is contained in:
Gianguido Sorà 2022-10-10 15:52:25 +02:00
parent db9372d5d0
commit 82c31e760b

View file

@ -30,9 +30,11 @@ impl From<DecodeError> for Error {
}
}
#[derive(
bincode::Encode, bincode::Decode, PartialEq, Debug, Default, prefsgenerator::GetterSetter,
)]
/// UserPrefs defines the set of all the user preference toggles available for Precursor.
/// Setters and getters are PDDB-aware, and are generated by the `prefsgenerator::GetterSetter` macro.
/// To add a new preference setting just drop a new struct entry in here.
/// The struct field type must be serializable by bincode.
#[derive(prefsgenerator::GetterSetter)]
struct UserPrefs {
radio_on_on_boot: bool,
connect_known_networks_on_boot: bool,
@ -94,11 +96,4 @@ impl Default for Manager {
fn default() -> Self {
Self::new()
}
}
mod test {
#[test]
fn describe() {
use crate::Manager;
let _m = Manager::new();
}
}