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