can_tools 2.1.2

Rust editor for CanDatabase. It allows to open and modify CAN database from .dbc and .arxml files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::types::database::CanDatabase;

/// Decodes a free-standing database comment (`CM_ "..."`).
pub(crate) fn decode(db: &mut CanDatabase, line: &str) {
    let s: &str = line.trim_end_matches(';');
    if let Some((_, rest)) = s.split_once('"')
        && let Some((inner, _)) = rest.rsplit_once('"')
    {
        db.comment = inner.to_string(); // quotes removed
    }
}