mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-28 13:31:14 +00:00
feat(no_std): remove redundant std
usages in ratatui-widgets
(#1762)
This commit is contained in:
parent
577bd17bba
commit
5a232a3115
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2660,6 +2660,7 @@ dependencies = [
|
||||
"color-eyre",
|
||||
"crossterm",
|
||||
"document-features",
|
||||
"hashbrown",
|
||||
"indoc",
|
||||
"instability",
|
||||
"itertools 0.13.0",
|
||||
|
@ -31,6 +31,7 @@ bitflags = "2.9.0"
|
||||
color-eyre = "0.6.3"
|
||||
crossterm = "0.28.1"
|
||||
document-features = "0.2.11"
|
||||
hashbrown = "0.15.2"
|
||||
indoc = "2.0.6"
|
||||
instability = "0.3.7"
|
||||
itertools = "0.13.0"
|
||||
|
@ -50,6 +50,7 @@ unstable-rendered-line-info = []
|
||||
bitflags.workspace = true
|
||||
crossterm.workspace = true
|
||||
document-features = { workspace = true, optional = true }
|
||||
hashbrown.workspace = true
|
||||
indoc.workspace = true
|
||||
instability.workspace = true
|
||||
itertools.workspace = true
|
||||
|
@ -14,7 +14,7 @@
|
||||
//! [widget examples]: https://github.com/ratatui/ratatui/blob/main/ratatui-widgets/examples
|
||||
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
|
||||
|
||||
use std::iter::zip;
|
||||
use core::iter::zip;
|
||||
|
||||
use color_eyre::Result;
|
||||
use crossterm::event::{self, Event};
|
||||
|
@ -14,7 +14,7 @@
|
||||
//! [widget examples]: https://github.com/ratatui/ratatui/blob/main/ratatui-widgets/examples
|
||||
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
|
||||
|
||||
use std::time::Duration;
|
||||
use core::time::Duration;
|
||||
|
||||
use color_eyre::Result;
|
||||
use crossterm::event::{self, Event, KeyCode, KeyEventKind};
|
||||
|
@ -14,7 +14,7 @@
|
||||
//! [widget examples]: https://github.com/ratatui/ratatui/blob/main/ratatui-widgets/examples
|
||||
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
|
||||
|
||||
use std::time::Duration;
|
||||
use core::time::Duration;
|
||||
|
||||
use color_eyre::Result;
|
||||
use crossterm::event::{self, Event};
|
||||
|
@ -1,5 +1,5 @@
|
||||
//! Border related types ([`Borders`], [`BorderType`]) and a macro to create borders ([`border`]).
|
||||
use std::fmt;
|
||||
use core::fmt;
|
||||
|
||||
use bitflags::bitflags;
|
||||
use ratatui_core::symbols::border;
|
||||
|
@ -8,8 +8,7 @@
|
||||
//! * a style is returned by the [`DateStyler`] for the day
|
||||
//!
|
||||
//! [`Monthly`] has several controls for what should be displayed
|
||||
use std::collections::HashMap;
|
||||
|
||||
use hashbrown::HashMap;
|
||||
use ratatui_core::buffer::Buffer;
|
||||
use ratatui_core::layout::{Alignment, Constraint, Layout, Rect};
|
||||
use ratatui_core::style::Style;
|
||||
|
@ -13,8 +13,8 @@
|
||||
//!
|
||||
//! You can also implement your own custom [`Shape`]s.
|
||||
|
||||
use std::fmt;
|
||||
use std::iter::zip;
|
||||
use core::fmt;
|
||||
use core::iter::zip;
|
||||
|
||||
use itertools::Itertools;
|
||||
use ratatui_core::buffer::Buffer;
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! The [`Chart`] widget is used to plot one or more [`Dataset`] in a cartesian coordinate system.
|
||||
use std::cmp::max;
|
||||
use std::ops::Not;
|
||||
use core::cmp::max;
|
||||
use core::ops::Not;
|
||||
|
||||
use ratatui_core::buffer::Buffer;
|
||||
use ratatui_core::layout::{Alignment, Constraint, Flex, Layout, Position, Rect};
|
||||
|
@ -79,6 +79,9 @@
|
||||
//! # License
|
||||
//!
|
||||
//! This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
pub mod barchart;
|
||||
pub mod block;
|
||||
pub mod borders;
|
||||
|
@ -218,7 +218,7 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::borrow::Cow;
|
||||
use alloc::borrow::Cow;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
use ratatui_core::style::{Color, Modifier, Stylize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! Internal module for reflowing text to fit into a certain width.
|
||||
use std::collections::VecDeque;
|
||||
use std::mem;
|
||||
use alloc::collections::VecDeque;
|
||||
use core::mem;
|
||||
|
||||
use ratatui_core::layout::Alignment;
|
||||
use ratatui_core::text::StyledGrapheme;
|
||||
|
@ -7,7 +7,7 @@
|
||||
clippy::module_name_repetitions
|
||||
)]
|
||||
|
||||
use std::iter;
|
||||
use core::iter;
|
||||
|
||||
use ratatui_core::buffer::Buffer;
|
||||
use ratatui_core::layout::Rect;
|
||||
@ -636,7 +636,7 @@ impl ScrollbarOrientation {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
use core::str::FromStr;
|
||||
|
||||
use ratatui_core::text::Text;
|
||||
use ratatui_core::widgets::Widget;
|
||||
|
@ -1,5 +1,5 @@
|
||||
//! The [`Sparkline`] widget is used to display a sparkline over one or more lines.
|
||||
use std::cmp::min;
|
||||
use core::cmp::min;
|
||||
|
||||
use ratatui_core::buffer::Buffer;
|
||||
use ratatui_core::layout::Rect;
|
||||
|
@ -1036,7 +1036,7 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::vec;
|
||||
use alloc::vec;
|
||||
|
||||
use ratatui_core::layout::Constraint::*;
|
||||
use ratatui_core::style::{Color, Modifier, Style, Stylize};
|
||||
|
@ -272,7 +272,7 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::vec;
|
||||
use alloc::vec;
|
||||
|
||||
use ratatui_core::style::{Color, Modifier, Stylize};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user