1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 14:26:17 +03:00

include all features at building doc on docs.rs

Этот коммит содержится в:
rhysd
2022-06-25 11:41:33 +09:00
родитель db0a6c9cc9
Коммит f8c12a8bf6
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@@ -53,3 +53,6 @@ required-features = ["crossterm"]
[[example]]
name = "variable"
required-features = ["crossterm"]
[package.metadata.docs.rs]
all-features = true

Просмотреть файл

@@ -67,7 +67,7 @@ pub struct Input {
}
impl Default for Input {
/// The default input is [`Key::Null`] without pressing Ctrl nor Alt, which means invalid input.
/// The default input is [`Key::Null`] without pressing any modifier keys, which means invalid input.
fn default() -> Self {
Input {
key: Key::Null,
@@ -79,6 +79,7 @@ impl Default for Input {
#[cfg(feature = "crossterm")]
impl From<CrosstermEvent> for Input {
/// Convert [`crossterm::event::Event`] to [`Input`].
fn from(event: CrosstermEvent) -> Self {
if let CrosstermEvent::Key(key) = event {
Self::from(key)
@@ -90,6 +91,7 @@ impl From<CrosstermEvent> for Input {
#[cfg(feature = "crossterm")]
impl From<KeyEvent> for Input {
/// Convert [`crossterm::event::KeyEvent`] to [`Input`].
fn from(key: KeyEvent) -> Self {
let ctrl = key.modifiers.contains(KeyModifiers::CONTROL);
let alt = key.modifiers.contains(KeyModifiers::ALT);
@@ -117,6 +119,7 @@ impl From<KeyEvent> for Input {
#[cfg(feature = "termion")]
impl From<TerimonEvent> for Input {
/// Convert [`termion::event::Event`] to [`Input`].
fn from(event: TerimonEvent) -> Self {
if let TerimonEvent::Key(key) = event {
Self::from(key)
@@ -128,6 +131,7 @@ impl From<TerimonEvent> for Input {
#[cfg(feature = "termion")]
impl From<TermionKey> for Input {
/// Convert [`termion::event::Key`] to [`Input`].
fn from(key: TermionKey) -> Self {
use TermionKey::*;