summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2018-08-14 00:13:08 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:28 +0300
commit591946a842a806a06739e38edd9011ce8cf940b0 (patch)
tree67cbf64f0f34b216d8d151e47bdef3673d75c818 /ui
parent5d0b7fa903a127064816389b83a433e42803cb61 (diff)
Fix qp header parsing
Diffstat (limited to 'ui')
-rw-r--r--ui/src/types/cells.rs28
-rw-r--r--ui/src/types/position.rs20
2 files changed, 29 insertions, 19 deletions
diff --git a/ui/src/types/cells.rs b/ui/src/types/cells.rs
index 6f3bd9a6..86d6fd6f 100644
--- a/ui/src/types/cells.rs
+++ b/ui/src/types/cells.rs
@@ -56,7 +56,7 @@ pub trait CellAccessor: HasSize {
///
/// # Examples
///
- /// ```no_run
+ /// ```norun
/// use rustty::{Terminal, CellAccessor};
///
/// let mut term = Terminal::new().unwrap();
@@ -75,7 +75,7 @@ pub trait CellAccessor: HasSize {
///
/// # Examples
///
- /// ```no_run
+ /// ```norun
/// use rustty::{Terminal, CellAccessor};
///
/// let mut term = Terminal::new().unwrap();
@@ -235,7 +235,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let cell = Cell::new('x', Color::Default, Color::Green, Attr::Default);
@@ -252,7 +252,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::with_char('x');
@@ -269,7 +269,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::with_style(Color::Default, Color::Red, Attr::Bold);
@@ -286,7 +286,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::Cell;
///
/// let mut cell = Cell::with_char('x');
@@ -300,7 +300,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::Cell;
///
/// let mut cell = Cell::with_char('x');
@@ -318,7 +318,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::with_style(Color::Blue, Color::Default, Attr::Default);
@@ -332,7 +332,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::default();
@@ -350,7 +350,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::with_style(Color::Default, Color::Green, Attr::Default);
@@ -364,7 +364,7 @@ impl Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color, Attr};
///
/// let mut cell = Cell::default();
@@ -393,7 +393,7 @@ impl Default for Cell {
///
/// # Examples
///
- /// ```
+ /// ```norun
/// use rustty::{Cell, Color};
///
/// let mut cell = Cell::default();
@@ -418,7 +418,7 @@ impl Default for Cell {
///
/// # Examples
///
-/// ```
+/// ```norun
/// use rustty::Color;
///
/// // The default color.
@@ -488,7 +488,7 @@ impl Color {
///
/// # Examples
///
-/// ```
+/// ```norun
/// use rustty::Attr;
///
/// // Default attribute.
diff --git a/ui/src/types/position.rs b/ui/src/types/position.rs
index ea12117c..90a5cfee 100644
--- a/ui/src/types/position.rs
+++ b/ui/src/types/position.rs
@@ -49,9 +49,11 @@ pub fn set_y(p: Pos, new_y: usize) -> Pos {
///
/// Example:
/// ```
-/// use ui::position;
+/// # #[macro_use] extern crate ui; fn main() {
+/// use ui::*;
///
/// let new_area = ((0, 0), (1, 1));
+/// # }
/// ```
pub type Area = (Pos, Pos);
@@ -59,10 +61,12 @@ pub type Area = (Pos, Pos);
///
/// Example:
/// ```
-/// use ui::position;
+/// # #[macro_use] extern crate ui; fn main() {
+/// use ui::*;
///
/// let new_area = ((0, 0), (1, 1));
/// assert_eq!(height!(new_area), 1);
+/// # }
/// ```
#[macro_export]
macro_rules! height {
@@ -75,10 +79,12 @@ macro_rules! height {
///
/// Example:
/// ```
-/// use ui::position;
+/// # #[macro_use] extern crate ui; fn main() {
+/// use ui::*;
///
/// let new_area = ((0, 0), (1, 1));
/// assert_eq!(upper_left!(new_area), (0, 0));
+/// # }
/// ```
#[macro_export]
macro_rules! upper_left {
@@ -91,10 +97,12 @@ macro_rules! upper_left {
///
/// Example:
/// ```
-/// use ui::position;
+/// # #[macro_use] extern crate ui; fn main() {
+/// use ui::*;
///
/// let new_area = ((0, 0), (1, 1));
/// assert_eq!(bottom_right!(new_area), (1, 1));
+/// # }
/// ```
#[macro_export]
macro_rules! bottom_right {
@@ -107,13 +115,15 @@ macro_rules! bottom_right {
///
/// Example:
/// ```
-/// use ui::position;
+/// # #[macro_use] extern crate ui; fn main() {
+/// use ui::*;
///
/// let valid_area = ((0, 0), (1, 1));
/// assert!(is_valid_area!(valid_area));
///
/// let invalid_area = ((2, 2), (1, 1));
/// assert!(!is_valid_area!(invalid_area));
+/// # }
///
#[macro_export]
macro_rules! is_valid_area {