rustyfit 0.5.0

This project hosts the Rust implementation for The Flexible and Interoperable Data Transfer (FIT) Protocol
Documentation
// Code generated by fitgen/main.go. DO NOT EDIT.

// Copyright 2025 The RustyFIT Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#![allow(unused, clippy::match_single_binding)]

use std::fmt;

#[derive(Clone, Copy, PartialEq)]
pub struct Weight(pub u16);

impl Weight {
    pub const CALCULATING: Weight = Weight(0xFFFE);
}

impl Default for Weight {
    fn default() -> Self {
        Self(u16::MAX)
    }
}

impl fmt::Display for Weight {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.0 {
            0xFFFE => write!(f, "calculating"),
            _ => write!(f, "Weight({})", self.0),
        }
    }
}

impl fmt::Debug for Weight {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.0 {
            0xFFFE => write!(f, "Weight::CALCULATING(0xFFFE)"),
            _ => write!(f, "Weight({})", self.0),
        }
    }
}