Export all types at top level

This commit is contained in:
Joscha 2023-02-16 09:18:08 +01:00
parent 0d59116012
commit 4ffaae067e
9 changed files with 21 additions and 23 deletions

View file

@ -2,8 +2,7 @@ use std::ops::{Add, AddAssign, Neg, Range, Sub, SubAssign};
use crossterm::style::ContentStyle;
use crate::styled::Styled;
use crate::widthdb::WidthDb;
use crate::{Styled, WidthDb};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct Size {

View file

@ -1,9 +1,7 @@
//! Rendering the next frame.
use crate::buffer::Buffer;
pub use crate::buffer::{Pos, Size};
use crate::styled::Styled;
use crate::widthdb::WidthDb;
use crate::{Pos, Size, Styled, WidthDb};
#[derive(Debug, Default)]
pub struct Frame {

View file

@ -10,8 +10,14 @@
#![warn(clippy::use_self)]
mod buffer;
pub mod frame;
pub mod styled;
pub mod terminal;
pub mod widthdb;
mod frame;
mod styled;
mod terminal;
mod widthdb;
mod wrap;
pub use buffer::{Pos, Size};
pub use frame::*;
pub use styled::*;
pub use terminal::*;
pub use widthdb::*;

View file

@ -1,5 +1,5 @@
use std::iter::Peekable;
use std::{slice, vec};
use std::slice;
use crossterm::style::{ContentStyle, StyledContent};
use unicode_segmentation::{GraphemeIndices, Graphemes, UnicodeSegmentation};

View file

@ -1,7 +1,7 @@
//! Displaying frames on a terminal.
use std::io::Write;
use std::{io, mem};
use std::io::{self, Write};
use std::mem;
use crossterm::cursor::{Hide, MoveTo, Show};
use crossterm::event::{
@ -12,9 +12,8 @@ use crossterm::style::{PrintStyledContent, StyledContent};
use crossterm::terminal::{Clear, ClearType, EnterAlternateScreen, LeaveAlternateScreen};
use crossterm::{ExecutableCommand, QueueableCommand};
use crate::buffer::{Buffer, Size};
use crate::frame::Frame;
use crate::widthdb::WidthDb;
use crate::buffer::Buffer;
use crate::{Frame, Size, WidthDb};
pub struct Terminal {
/// Render target.

View file

@ -3,7 +3,7 @@
use unicode_linebreak::BreakOpportunity;
use unicode_segmentation::UnicodeSegmentation;
use crate::widthdb::WidthDb;
use crate::WidthDb;
pub fn wrap(widthdb: &mut WidthDb, text: &str, width: usize) -> Vec<usize> {
let mut breaks = vec![];