qrism 0.1.0

A Rust library for generating and reading QR codes with Reed-Solomon error correction. Supports traditional monochromatic QR codes with additional experimental multicolor QR support for enhanced storage capacity.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use super::{QRError, QRResult};

pub fn f64_to_i32(num: &f64) -> QRResult<i32> {
    let num = *num;

    if num < i32::MIN as f64 || num > i32::MAX as f64 {
        return Err(QRError::CastingFailed);
    }

    Ok(num as i32)
}