FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
assert_cmd/examples/example_fixture.rs at master · tailhook/assert_cmd · GitHub
tailhook
/
assert_cmd
Public
forked from
assert-rs/assert_cmd
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
assert_cmd
/
examples
/
example_fixture.rs
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (29 loc) · 696 Bytes
Breadcrumbs
assert_cmd
/
examples
/
example_fixture.rs
Copy path
File metadata and controls
32 lines (29 loc) · 696 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use
std
::
env
;
use
std
::
error
::
Error
;
use
std
::
io
;
use
std
::
io
::
Write
;
use
std
::
process
;
fn
run
(
)
->
Result
<
(
)
,
Box
<
dyn
Error
>
>
{
if
let
Ok
(
text
)
= env
::
var
(
"stdout"
)
{
println
!
(
"{}"
,
text
)
;
}
if
let
Ok
(
text
)
= env
::
var
(
"stderr"
)
{
eprintln
!
(
"{}"
,
text
)
;
}
let
code = env
::
var
(
"exit"
)
.
ok
(
)
.
map
(
|v| v
.
parse
::
<
i32
>
(
)
)
.
map_or
(
Ok
(
None
)
,
|r| r
.
map
(
Some
)
)
?
.
unwrap_or
(
0
)
;
process
::
exit
(
code
)
;
}
fn
main
(
)
{
let
code =
match
run
(
)
{
Ok
(
_
)
=>
0
,
Err
(
ref
e
)
=>
{
write
!
(
&
mut
io
::
stderr
(
)
,
"{}"
,
e
)
.
expect
(
"writing to stderr won't fail"
)
;
1
}
}
;
process
::
exit
(
code
)
;
}
Back
|
FazBrowse Home
|
New Git URL