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;

/// Parses the `VERSION` line and stores the version string on the database.
pub(crate) fn decode(db: &mut CanDatabase, line: &str) {
    db.version = line
        .to_lowercase()
        .replace("version", "") // delete version text
        .trim() // delete whitespaces
        .trim_matches('"') // delete "
        .to_string() // convert in string
}