Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
c1886010
Commit
c1886010
authored
2 years ago
by
Georgy Moshkin
Committed by
Georgy Moshkin
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: move mod tests to the end of file
parent
90b13fbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!302
feat(notify): print expected and actual type names on downcast error
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/util.rs
+16
-16
16 additions, 16 deletions
src/util.rs
with
16 additions
and
16 deletions
src/util.rs
+
16
−
16
View file @
c1886010
...
...
@@ -353,6 +353,22 @@ pub const fn str_eq(lhs: &str, rhs: &str) -> bool {
}
}
////////////////////////////////////////////////////////////////////////////////
/// Return terminal screen size in rows, columns.
pub
fn
screen_size
()
->
(
i32
,
i32
)
{
let
mut
rows
=
std
::
mem
::
MaybeUninit
::
uninit
();
let
mut
cols
=
std
::
mem
::
MaybeUninit
::
uninit
();
unsafe
{
rl_get_screen_size
(
rows
.as_mut_ptr
(),
cols
.as_mut_ptr
());
return
(
rows
.assume_init
()
as
_
,
cols
.assume_init
()
as
_
);
}
use
std
::
os
::
raw
::
c_int
;
extern
"C"
{
pub
fn
rl_get_screen_size
(
rows
:
*
mut
c_int
,
cols
:
*
mut
c_int
);
}
}
#[cfg(test)]
mod
tests
{
#[test]
...
...
@@ -383,19 +399,3 @@ mod tests {
assert!
(
!
str_eq
(
"foo1"
,
"foo2"
));
}
}
////////////////////////////////////////////////////////////////////////////////
/// Return terminal screen size in rows, columns.
pub
fn
screen_size
()
->
(
i32
,
i32
)
{
let
mut
rows
=
std
::
mem
::
MaybeUninit
::
uninit
();
let
mut
cols
=
std
::
mem
::
MaybeUninit
::
uninit
();
unsafe
{
rl_get_screen_size
(
rows
.as_mut_ptr
(),
cols
.as_mut_ptr
());
return
(
rows
.assume_init
()
as
_
,
cols
.assume_init
()
as
_
);
}
use
std
::
os
::
raw
::
c_int
;
extern
"C"
{
pub
fn
rl_get_screen_size
(
rows
:
*
mut
c_int
,
cols
:
*
mut
c_int
);
}
}
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