зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
chore: migrate to Rust 2024 edition and bump to v0.9.2 (#12)
* chore: migrate to Rust 2024 edition and bump to v0.9.2 - Bump edition to 2024 and rust-version to 1.85.0 - Replace f64::log10 with usize::ilog10 in num_digits - Fix clippy lints surfaced by edition bump: repeat_n, derived Default, then_some - Expand watch-check and watch-test aliases to cover all feature paths (crossterm_0_28, no-backend, tuirs variants, serde, arbitrary) - Expand CI test and clippy workflows to full 6/8-entry feature matrices including termion on Ubuntu - Apply rustfmt import reordering from edition 2024 rules * fix: revert turis linux checks
Этот коммит содержится в:
@@ -5,7 +5,6 @@ use crate::util::{num_digits, spaces};
|
||||
use ratatui_core::text::Line;
|
||||
use std::borrow::Cow;
|
||||
use std::cmp::Ordering;
|
||||
use std::iter;
|
||||
#[cfg(feature = "tuirs")]
|
||||
use tui::text::Spans as Line;
|
||||
use unicode_width::UnicodeWidthChar as _;
|
||||
@@ -64,7 +63,7 @@ impl DisplayTextBuilder {
|
||||
fn build<'s>(&mut self, s: &'s str) -> Cow<'s, str> {
|
||||
if let Some(ch) = self.mask {
|
||||
// Note: We don't need to track width on masking text since width of tab character is fixed
|
||||
let masked = iter::repeat(ch).take(s.chars().count()).collect();
|
||||
let masked = std::iter::repeat_n(ch, s.chars().count()).collect();
|
||||
return Cow::Owned(masked);
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ impl DisplayTextBuilder {
|
||||
pub struct LineHighlighter<'a> {
|
||||
line: &'a str,
|
||||
spans: Vec<Span<'a>>,
|
||||
boundaries: Vec<(Boundary, usize)>, // TODO: Consider smallvec
|
||||
boundaries: Vec<(Boundary, usize)>,
|
||||
style_begin: Style,
|
||||
cursor_at_end: bool,
|
||||
cursor_style: Style,
|
||||
|
||||
Ссылка в новой задаче
Block a user