mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 22:17:07 +02:00
fix warns
This commit is contained in:
parent
81bc0c67a3
commit
5ca329292f
11 changed files with 16 additions and 21 deletions
|
|
@ -150,7 +150,6 @@ features! {
|
|||
layout,
|
||||
lrtb,
|
||||
sizer,
|
||||
space,
|
||||
split,
|
||||
thunk,
|
||||
xywh
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(unused)]
|
||||
|
||||
use crate::*;
|
||||
|
||||
impl<S: Screen, T: Draw<S>> Layout<S> for T {}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
use crate::*;
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
use crate::*;
|
||||
use crate::{*, lang::*, draw::*, task::*, exit::*};
|
||||
use crate::lang::*;
|
||||
use ::ratatui::buffer::Cell;
|
||||
|
||||
/// TUI buffer sized by `usize` instead of `u16`.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::*;
|
||||
use ratatui::prelude::Color;
|
||||
use dizzle::{Ostensibly, Expression, LanguageError::*};
|
||||
use dizzle::{Expression, LanguageError::*};
|
||||
|
||||
pub trait ColorDsl<T>: Sized {
|
||||
fn new_g (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps<u8>) -> Usually<Self>;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
use crate::{task::Task, term::TuiEvent};
|
||||
use ::std::sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}};
|
||||
use ::std::time::Duration;
|
||||
use ::dizzle::{Language, Symbol, Usually, Apply};
|
||||
use ::crossterm::event::{
|
||||
read, Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState
|
||||
};
|
||||
use ::dizzle::{Language, Symbol, Usually};
|
||||
use ::crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState};
|
||||
|
||||
/// TUI key spec.
|
||||
#[derive(Debug, Clone, Eq, PartialEq, PartialOrd)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use crate::*;
|
||||
|
||||
/// Stackably padded.
|
||||
///
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::*;
|
||||
use ratatui::{prelude::{Style, Position, Backend, Color}};
|
||||
use ratatui::{prelude::{Position}};
|
||||
|
||||
pub const fn x_repeat (c: &str) -> impl Draw<Tui> {
|
||||
thunk(move|to: &mut Tui|{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::*;
|
||||
use ratatui::{prelude::{Style, Position, Backend, Color}};
|
||||
use ratatui::{prelude::{Position}};
|
||||
|
||||
pub const ICON_DEC_V: &[char] = &['▲'];
|
||||
pub const ICON_INC_V: &[char] = &['▼'];
|
||||
|
|
@ -7,7 +7,7 @@ pub const ICON_DEC_H: &[char] = &[' ', '🞀', ' '];
|
|||
pub const ICON_INC_H: &[char] = &[' ', '🞂', ' '];
|
||||
|
||||
pub fn x_scroll () -> impl Draw<Tui> {
|
||||
thunk(|Tui(buf, XYWH(x1, y1, w, h)): &mut Tui|{
|
||||
thunk(|Tui(buf, XYWH(x1, y1, w, _h)): &mut Tui|{
|
||||
let x2 = *x1 + *w;
|
||||
for (i, x) in (*x1..=x2).enumerate() {
|
||||
if let Some(cell) = buf.cell_mut(Position::from((x, *y1))) {
|
||||
|
|
@ -35,7 +35,7 @@ pub fn x_scroll () -> impl Draw<Tui> {
|
|||
}
|
||||
|
||||
pub fn y_scroll () -> impl Draw<Tui> {
|
||||
thunk(|Tui(buf, XYWH(x1, y1, w, h)): &mut Tui|{
|
||||
thunk(|Tui(buf, XYWH(x1, y1, _w, h)): &mut Tui|{
|
||||
let y2 = *y1 + *h;
|
||||
for (i, y) in (*y1..=y2).enumerate() {
|
||||
if let Some(cell) = buf.cell_mut(Position::from((*x1, y))) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(unused)]
|
||||
|
||||
use crate::*;
|
||||
pub(crate) use ::unicode_width::*;
|
||||
|
||||
|
|
@ -96,7 +98,9 @@ pub fn trim_string (max_width: usize, input: impl AsRef<str>) -> String {
|
|||
pub struct TrimString<T: AsRef<str>>(pub u16, pub T);
|
||||
impl<T: AsRef<str>> AsRef<str> for TrimString<T> { fn as_ref (&self) -> &str { self.1.as_ref() } }
|
||||
impl<'a, T: AsRef<str>> TrimString<T> {
|
||||
fn to_ref (&self) -> TrimStringRef<'_, T> { TrimStringRef(self.0, &self.1) }
|
||||
fn to_ref (&self) -> TrimStringRef<'_, T> {
|
||||
TrimStringRef(self.0, &self.1)
|
||||
}
|
||||
}
|
||||
|
||||
/// Displays a borrowed [str]-like with fixed maximum width
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue