1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// License: see LICENSE file at root directory of `master` branch

//! # RGB-IO
//!
//! ## Project
//!
//! - Repository: <https://bitbucket.org/haibison/rgb-io>
//! - License: Nice License 1.0.0 _(see LICENSE file at root directory of `master` branch)_
//! - _This project follows [Semantic Versioning 2.0.0]_
//!
//! ## Features
//!
//! This is a simple program, which lets you type in RGB color(s) in hexadecimal format, then prints sample color(s) to standard ouput.
//!
//! You can run the program with `help` command for more details.
//!
//! ## Building from source or installing via Cargo
//!
//! This crate is intended to be used as a program. So default features just contain some documentation, constants and no dependencies.
//!
//! `bin` feature contains a binary which uses some dependencies.
//!
//! ### Building from source:
//!
//! ```shell
//! ~> # Clone a specific version via tag name
//! ~> git clone --branch=x.y.z --depth=1 -- https://bitbucket.org/haibison/rgb-io rgb-io-x.y.z/
//! ~> cd rgb-io-x.y.z/
//! ~> cargo build --release --features=bin
//! ```
//!
//! ### Installing via Cargo:
//!
//! ```shell
//! ~> cargo install rgb-io --version=x.y.z --features=bin
//! ```
//!
//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html

#![warn(missing_docs)]
#![forbid(unsafe_code)]

// ╔═════════════════╗
// ║   IDENTIFIERS   ║
// ╚═════════════════╝

macro_rules! code_name  { () => { "rgb-io" }}
macro_rules! version    { () => { "0.2.0" }}

/// # Crate name
pub const NAME: &str = "RGB-IO";

/// # Crate code name
pub const CODE_NAME: &str = code_name!();

/// # ID of this crate
pub const ID: &str = concat!(
    "7bc0b3e2-15657bb9-948b50f2-2e16b5f8-57035ffe-15a77504-755029d1-b86572a8-",
    "d10b7fb4-ec1f842b-2c671d4a-ce9f0724-c6cb6197-a77a095e-7bf075cd-e5cff89f",
);

/// # Crate version
pub const VERSION: &str = version!();

/// # Crate release date (year/month/day)
pub const RELEASE_DATE: (u16, u8, u8) = (2019, 12, 12);

/// # Tag, which can be used for logging...
pub const TAG: &str = concat!(code_name!(), "::7bc0b3e2::", version!());

// ╔════════════════════╗
// ║   IMPLEMENTATION   ║
// ╚════════════════════╝

pub mod version_info;

/// # Result type used in this crate
pub type Result<T> = core::result::Result<T, Error>;

/// # Error type used in this crate
pub type Error = std::io::Error;

#[test]
fn test_crate_version() {
    assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
}