Skip to main content

libutils_issue/
mod.rs

1//^
2//^ HEAD
3//^
4
5//> HEAD -> NO_STD
6#![no_std]
7
8//> HEAD -> DOCS
9#![doc = include_str!("README.md")]
10
11//> HEAD -> FEATURES
12#![feature(const_convert)]
13#![feature(default_field_values)]
14#![feature(const_trait_impl)]
15
16//> HEAD -> CRATES
17extern crate alloc;
18
19//> HEAD -> MODULES
20mod conversions;
21mod severity;
22#[cfg(test)]
23mod tests;
24
25//> HEAD -> ALLOC
26use alloc::string::String;
27
28//> HEAD -> SEVERITY
29pub use severity::Severity;
30
31//> HEAD -> CORE
32use core::hash::{
33    Hash,
34    Hasher
35};
36
37
38//^
39//^ ISSUE
40//^
41
42//> ISSUE -> STRUCT
43#[derive(Debug)]
44pub struct Issue {
45    pub name: &'static str,
46    pub description: Option<String> = None,
47    pub severity: Severity = Severity::Error
48}
49
50//> ISSUE -> HASH
51impl Hash for Issue {
52    fn hash<H: Hasher>(&self, state: &mut H) {Hash::hash(self.name, state)}
53}