From a19d2e245d22bc839419b07aa9eca8a9753f5517 Mon Sep 17 00:00:00 2001 From: Ticki Date: Tue, 8 Mar 2016 08:27:59 +0100 Subject: [PATCH] Make debug_check private, remove warnings from examples --- examples/simple.rs | 4 ++-- src/color.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple.rs b/examples/simple.rs index dbdb693..d739482 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -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(); diff --git a/src/color.rs b/src/color.rs index 34aa0ef..c927b9c 100644 --- a/src/color.rs +++ b/src/color.rs @@ -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);