Make debug_check private, remove warnings from examples
This commit is contained in:
parent
491facd4e7
commit
a19d2e245d
|
@ -1,12 +1,12 @@
|
|||
extern crate libterm;
|
||||
|
||||
use libterm::{TermControl, IntoRawMode, Color, Mode, ReadExt};
|
||||
use libterm::{TermControl, IntoRawMode, Color, Mode};
|
||||
use std::io::{Read, Write, stdout, stdin};
|
||||
|
||||
fn main() {
|
||||
let stdout = stdout();
|
||||
let mut stdout = stdout.lock().into_raw_mode().unwrap();
|
||||
let mut stdin = stdin();
|
||||
let stdin = stdin();
|
||||
|
||||
stdout.goto(5, 5).unwrap();
|
||||
stdout.clear().unwrap();
|
||||
|
|
|
@ -33,7 +33,7 @@ pub enum Color {
|
|||
HiCyan,
|
||||
/// High-intensity white.
|
||||
HiWhite,
|
||||
/// 216-color (6, 6, 6) RGB.
|
||||
/// 216-color (r, g, b ≤ 5) RGB.
|
||||
Rgb(u8, u8, u8),
|
||||
/// Grayscale (max value: 24)
|
||||
Grayscale(u8),
|
||||
|
@ -67,7 +67,7 @@ impl Color {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn debug_check(self) {
|
||||
fn debug_check(self) {
|
||||
match self {
|
||||
Rgb(r, g, b) => {
|
||||
debug_assert!(r <= 5, "Red color fragment (r = {}) is out of bound. Make sure r ≤ 5.", r);
|
||||
|
|
Loading…
Reference in New Issue