use crate::config::user_opts::LiteralsOptions;
use serde::{Deserialize, Serialize};
#[derive(Debug, Copy, Clone, Default)]
pub struct Literals {
pub format_strings: bool,
pub hex_literal_case: HexLiteralCase,
}
impl Literals {
pub fn from_opts(opts: &LiteralsOptions) -> Self {
let default = Self::default();
Self {
format_strings: opts.format_strings.unwrap_or(default.format_strings),
hex_literal_case: opts.hex_literal_case.unwrap_or(default.hex_literal_case),
}
}
}
#[derive(Serialize, Deserialize, Debug, Copy, Clone, Default)]
pub enum HexLiteralCase {
#[default]
Preserve,
Upper,
Lower,
}