Skip to content

Commit

Permalink
fix: 🐛 add serde to kernel version struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Schleicher committed Oct 25, 2024
1 parent c689620 commit 0688fce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions procfs-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ pub struct ExplicitSystemInfo {
pub ticks_per_second: u64,
pub page_size: u64,
pub is_little_endian: bool,
#[cfg_attr(feature = "serde1", serde(skip))]
pub kernel_version: KernelVersion,
}

Expand Down
6 changes: 5 additions & 1 deletion procfs-core/src/sys/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ use std::cmp;
use std::collections::HashSet;
use std::str::FromStr;

#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};

use bitflags::bitflags;

use crate::{ProcError, ProcResult};

/// Represents a kernel version, in major.minor.release version.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct Version {
pub major: u8,
pub minor: u8,
Expand Down

0 comments on commit 0688fce

Please sign in to comment.