postcard-bindgen-core 0.3.5

A crate to generate bindings for the postcard binary format for other languages than Rust - Core Crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use convert_case::{Case, Casing};

pub trait StrExt {
    fn to_obj_identifier(&self) -> String;
}

impl<'a> StrExt for &'a str {
    fn to_obj_identifier(&self) -> String {
        self.to_case(Case::Snake).to_uppercase()
    }
}

#[cfg(test)]
pub fn assert_tokens(generated: genco::lang::js::Tokens, compare: genco::lang::js::Tokens) {
    assert_eq!(generated.to_file_string(), compare.to_file_string())
}