Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Commits
cb056d3a
Commit
cb056d3a
authored
6 years ago
by
gwenn
Browse files
Options
Downloads
Patches
Plain Diff
Fix warnings
parent
9b9c3527
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib.rs
+3
-1
3 additions, 1 deletion
src/lib.rs
src/tty/unix.rs
+2
-3
2 additions, 3 deletions
src/tty/unix.rs
with
5 additions
and
4 deletions
src/lib.rs
+
3
−
1
View file @
cb056d3a
...
@@ -344,7 +344,6 @@ fn reverse_incremental_search<R: RawReader>(
...
@@ -344,7 +344,6 @@ fn reverse_incremental_search<R: RawReader>(
/// Handles reading and editting the readline buffer.
/// Handles reading and editting the readline buffer.
/// It will also handle special inputs in an appropriate fashion
/// It will also handle special inputs in an appropriate fashion
/// (e.g., C-c will exit readline)
/// (e.g., C-c will exit readline)
#[allow(let_unit_value)]
fn
readline_edit
<
H
:
Helper
>
(
fn
readline_edit
<
H
:
Helper
>
(
prompt
:
&
str
,
prompt
:
&
str
,
initial
:
Option
<
(
&
str
,
&
str
)
>
,
initial
:
Option
<
(
&
str
,
&
str
)
>
,
...
@@ -581,6 +580,9 @@ fn readline_edit<H: Helper>(
...
@@ -581,6 +580,9 @@ fn readline_edit<H: Helper>(
}
}
}
}
}
}
if
cfg!
(
windows
)
{
let
_
=
original_mode
;
// silent warning
}
Ok
(
s
.line
.into_string
())
Ok
(
s
.line
.into_string
())
}
}
...
...
This diff is collapsed.
Click to expand it.
src/tty/unix.rs
+
2
−
3
View file @
cb056d3a
...
@@ -31,8 +31,8 @@ fn get_win_size() -> (usize, usize) {
...
@@ -31,8 +31,8 @@ fn get_win_size() -> (usize, usize) {
unsafe
{
unsafe
{
let
mut
size
:
libc
::
winsize
=
zeroed
();
let
mut
size
:
libc
::
winsize
=
zeroed
();
match
libc
::
ioctl
(
STDOUT_FILENO
,
libc
::
TIOCGWINSZ
.into
(),
&
mut
size
)
{
// https://github.com/rust-lang/libc/pull/704
// .into() for FreeBSD
match
libc
::
ioctl
(
STDOUT_FILENO
,
libc
::
TIOCGWINSZ
as
libc
::
c_ulong
,
&
mut
size
)
{
0
=>
(
size
.ws_col
as
usize
,
size
.ws_row
as
usize
),
// TODO getCursorPosition
0
=>
(
size
.ws_col
as
usize
,
size
.ws_row
as
usize
),
// TODO getCursorPosition
_
=>
(
80
,
24
),
_
=>
(
80
,
24
),
}
}
...
@@ -487,7 +487,6 @@ impl Renderer for PosixRenderer {
...
@@ -487,7 +487,6 @@ impl Renderer for PosixRenderer {
/// Control characters are treated as having zero width.
/// Control characters are treated as having zero width.
/// Characters with 2 column width are correctly handled (not splitted).
/// Characters with 2 column width are correctly handled (not splitted).
#[allow(if_same_then_else)]
fn
calculate_position
(
&
self
,
s
:
&
str
,
orig
:
Position
)
->
Position
{
fn
calculate_position
(
&
self
,
s
:
&
str
,
orig
:
Position
)
->
Position
{
let
mut
pos
=
orig
;
let
mut
pos
=
orig
;
let
mut
esc_seq
=
0
;
let
mut
esc_seq
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment