Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lassi Pulkkinen
termion
Commits
a448f510
Verified
Commit
a448f510
authored
Jan 20, 2020
by
Jeremy Soller
Browse files
1.5.5 - fix warnings
parent
6cb4e3fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Cargo.toml
View file @
a448f510
[package]
name
=
"termion"
version
=
"1.5.
4
"
version
=
"1.5.
5
"
authors
=
[
"ticki <Ticki@users.noreply.github.com>"
,
"gycos <alexandre.bury@gmail.com>"
,
"IGI-111 <igi-111@protonmail.com>"
]
description
=
"A bindless library for manipulating terminals."
repository
=
"https://gitlab.redox-os.org/redox-os/termion"
...
...
src/event.rs
View file @
a448f510
...
...
@@ -119,8 +119,8 @@ pub fn parse_event<I>(item: u8, iter: &mut I) -> Result<Event, Error>
parse_csi
(
iter
)
.ok_or
(
error
)
?
}
Some
(
Ok
(
c
))
=>
{
let
ch
=
parse_utf8_char
(
c
,
iter
);
Event
::
Key
(
Key
::
Alt
(
try
!
(
ch
))
)
let
ch
=
parse_utf8_char
(
c
,
iter
)
?
;
Event
::
Key
(
Key
::
Alt
(
ch
))
}
Some
(
Err
(
_
))
|
None
=>
return
Err
(
error
),
})
...
...
@@ -133,8 +133,8 @@ pub fn parse_event<I>(item: u8, iter: &mut I) -> Result<Event, Error>
b'\0'
=>
Ok
(
Event
::
Key
(
Key
::
Null
)),
c
=>
{
Ok
({
let
ch
=
parse_utf8_char
(
c
,
iter
);
Event
::
Key
(
Key
::
Char
(
try
!
(
ch
))
)
let
ch
=
parse_utf8_char
(
c
,
iter
)
?
;
Event
::
Key
(
Key
::
Char
(
ch
))
})
}
}
...
...
src/input.rs
View file @
a448f510
...
...
@@ -121,7 +121,7 @@ pub trait TermRead {
/// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will
/// complete the input.
fn
read_passwd
<
W
:
Write
>
(
&
mut
self
,
writer
:
&
mut
W
)
->
io
::
Result
<
Option
<
String
>>
{
let
_raw
=
try
!
(
writer
.into_raw_mode
()
)
;
let
_raw
=
writer
.into_raw_mode
()
?
;
self
.read_line
()
}
}
...
...
@@ -152,8 +152,8 @@ impl<R: Read + TermReadEventsAndRaw> TermRead for R {
}
}
let
string
=
try
!
(
String
::
from_utf8
(
buf
)
.map_err
(|
e
|
io
::
Error
::
new
(
io
::
ErrorKind
::
InvalidData
,
e
))
)
;
let
string
=
String
::
from_utf8
(
buf
)
.map_err
(|
e
|
io
::
Error
::
new
(
io
::
ErrorKind
::
InvalidData
,
e
))
?
;
Ok
(
Some
(
string
))
}
}
...
...
src/raw.rs
View file @
a448f510
...
...
@@ -102,11 +102,13 @@ impl<W: Write> IntoRawMode for W {
}
impl
<
W
:
Write
>
RawTerminal
<
W
>
{
/// Temporarily switch to original mode
pub
fn
suspend_raw_mode
(
&
self
)
->
io
::
Result
<
()
>
{
set_terminal_attr
(
&
self
.prev_ios
)
?
;
Ok
(())
}
/// Temporarily switch to raw mode
pub
fn
activate_raw_mode
(
&
self
)
->
io
::
Result
<
()
>
{
let
mut
ios
=
get_terminal_attr
()
?
;
raw_terminal_attr
(
&
mut
ios
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment