pub struct RuleDoc {
pub name: &'static str,
pub category: &'static str,
pub description: &'static str,
pub severity: &'static str,
pub why: &'static str,
pub bad_example: &'static str,
pub good_example: &'static str,
pub references: &'static [&'static str],
}
#[derive(Debug, Clone)]
pub struct RuleDocOwned {
pub name: String,
pub category: String,
pub description: String,
pub severity: String,
pub why: String,
pub bad_example: String,
pub good_example: String,
pub references: Vec<String>,
pub is_plugin: bool,
}
impl From<&RuleDoc> for RuleDocOwned {
fn from(doc: &RuleDoc) -> Self {
Self {
name: doc.name.to_string(),
category: doc.category.to_string(),
description: doc.description.to_string(),
severity: doc.severity.to_string(),
why: doc.why.to_string(),
bad_example: doc.bad_example.to_string(),
good_example: doc.good_example.to_string(),
references: doc.references.iter().map(|s| s.to_string()).collect(),
is_plugin: false,
}
}
}