interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / proc-macro2 / src / num.rs

17 lines · 342 bytes Raw Blame History
1// TODO: use NonZero<char> in Rust 1.89+
2#[derive(Copy, Clone, Debug, PartialEq, Eq)]
3pub struct NonZeroChar(char);
4
5impl NonZeroChar {
6 pub fn new(ch: char) -> Option<Self> {
7 if ch == '\0' {
8 None
9 } else {
10 Some(NonZeroChar(ch))
11 }
12 }
13
14 pub fn get(self) -> char {
15 self.0
16 }
17}