rustyfit 0.9.0

The #![no_std] Rust implementation of The Flexible and Interoperable Data Transfer (FIT) Protocol for decoding and encoding Garmin FIT files, supporting FIT Protocol V2.
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 core::fmt;

#[repr(transparent)]
#[derive(Clone, Copy, PartialEq)]
pub struct Gender(pub u8);

impl Gender {
    pub const FEMALE: Gender = Gender(0);
    pub const MALE: Gender = Gender(1);
}

impl Default for Gender {
    fn default() -> Self {
        Self(u8::MAX)
    }
}

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

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