pub fn encode_string(s: &str) -> String {
    // fn rule_4(s:&str) -> bool {
    // s.contains('-') && s.len() > 1 && s.as_bytes()[0] != 45
    // }
    if s.contains('(') || s.contains(' ') || s.contains(')') || s.contains('\t') || s.contains('{')
        || s.contains('}') || s.contains('}') || s.contains('%') || s.is_empty()
    // || rule_4(s)
    {
        format!("\"{}\"", s)
    } else {
        String::from(s)
    }
}
/// encode a string according to the guidelines given by Kicad
encode a string according to the guidelines given by Kicad
encode a string according to the guidelines given by Kicad
pub fn encode_string(s: &str) -> String {
    // fn rule_4(s:&str) -> bool {
    // s.contains('-') && s.len() > 1 && s.as_bytes()[0] != 45
    // }
    if s.contains('(') || s.contains(' ') || s.contains(')') || s.contains('\t') || s.contains('{')
        || s.contains('}') || s.contains('}') || s.contains('%') || s.is_empty()
    // || rule_4(s)
    {
        format!("\"{}\"", s)
    } else {
        String::from(s)
    }
}
pub fn encode_string ( s : & str ) -> String { // fn rule_4(s:&str) -> bool { // s.contains('-') && s.len() > 1 && s.as_bytes()[0] != 45 // } if s . contains ( '(' ) || s . contains ( ' ' ) || s . contains ( ')' ) || s . contains ( '\t' ) || s . contains ( '{' ) || s . contains ( '}' ) || s . contains ( '}' ) || s . contains ( '%' ) || s . is_empty ( ) // || rule_4(s) { format ! ( " \" \" " s ) } else { String :: from ( s ) } }
encode a string according to the guidelines given by Kicad
encode a string according to the guidelines given by Kicad
s
&str