Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump up the version of crossterm to v0.28.1 #30

Merged
merged 2 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion promkit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ path = "src/lib.rs"

[dependencies]
anyhow = "1.0.81"
crossterm = { version = "0.27.0", features = ["use-dev-tty"] }
crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
indexmap = "2.2.3"
radix_trie = "0.2.1"
serde = { version = "1.0.197" }
Expand Down
6 changes: 0 additions & 6 deletions promkit/src/core/listbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ impl<T: fmt::Display> FromIterator<T> for Listbox {
}
}

impl FromIterator<StyledGraphemes> for Listbox {
fn from_iter<T: IntoIterator<Item = StyledGraphemes>>(iter: T) -> Self {
Self(Cursor::new(iter.into_iter().collect(), 0, false))
}
}

impl Listbox {
/// Returns a reference to the vector of items in the listbox.
pub fn items(&self) -> &Vec<StyledGraphemes> {
Expand Down
15 changes: 6 additions & 9 deletions promkit/src/grapheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ impl From<char> for StyledGrapheme {
}
}

impl ToString for StyledGrapheme {
fn to_string(&self) -> String {
self.ch.to_string()
impl fmt::Display for StyledGraphemes {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for styled_grapheme in self.iter() {
write!(f, "{}", styled_grapheme.ch)?;
}
Ok(())
}
}

Expand Down Expand Up @@ -117,12 +120,6 @@ impl fmt::Debug for StyledGraphemes {
}
}

impl ToString for StyledGraphemes {
fn to_string(&self) -> String {
self.iter().map(|g| g.ch).collect()
}
}

impl StyledGraphemes {
pub fn from_str<S: AsRef<str>>(string: S, style: ContentStyle) -> Self {
string
Expand Down
Loading