use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProfileConfig {
pub opt_level: String,
pub lto: String,
pub strip: bool,
pub codegen_units: u32,
pub panic: String,
}
impl Default for ProfileConfig {
fn default() -> Self {
Self {
lto: "fat".to_string(), codegen_units: 1, opt_level: "s".to_string(), strip: true, panic: "abort".to_string(), }
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_profile_config_default_has_expected_values() {
let config = ProfileConfig::default();
assert_eq!(config.lto, "fat");
assert_eq!(config.codegen_units, 1);
assert_eq!(config.opt_level, "s");
assert!(config.strip);
assert_eq!(config.panic, "abort");
}
}