File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
examples/zguide/weather_server Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ bitflags = "1.0"
3535
3636[dev-dependencies ]
3737env_logger = " 0.6"
38- quickcheck = " 0.8 "
39- rand = " 0.6 "
38+ quickcheck = " 0.9 "
39+ rand = " 0.7 "
4040tempfile = " 3"
4141timebomb = " 0.1.2"
42- nix = " 0.13 "
42+ nix = " 0.15 "
4343compiletest_rs = { version = " 0.3.10" , features = [" stable" ] }
4444
4545[[example ]]
Original file line number Diff line number Diff line change 44//! Binds PUB socket to tcp://*:5556 and ipc://weather.ipc
55//! Publishes random weather updates
66
7- use rand:: rngs:: SmallRng ;
8- use rand:: FromEntropy ;
97use rand:: Rng ;
108
119fn main ( ) {
@@ -15,7 +13,7 @@ fn main() {
1513 assert ! ( publisher. bind( "tcp://*:5556" ) . is_ok( ) ) ;
1614 assert ! ( publisher. bind( "ipc://weather.ipc" ) . is_ok( ) ) ;
1715
18- let mut rng = SmallRng :: from_entropy ( ) ;
16+ let mut rng = rand :: thread_rng ( ) ;
1917
2018 loop {
2119 let zipcode = rng. gen_range ( 0 , 100_000 ) ;
Original file line number Diff line number Diff line change 55// the basis for integration with external event loops works.
66
77use log:: debug;
8- use nix:: poll;
8+ use nix:: poll:: { self , PollFlags } ;
99
1010use super :: with_connection;
1111
@@ -64,7 +64,7 @@ impl<'a> PollState<'a> {
6464 let fd = socket. get_fd ( ) . unwrap ( ) ;
6565 PollState {
6666 socket,
67- fds : [ poll:: PollFd :: new ( fd, poll :: EventFlags :: POLLIN ) ] ,
67+ fds : [ poll:: PollFd :: new ( fd, PollFlags :: POLLIN ) ] ,
6868 }
6969 }
7070
@@ -77,7 +77,7 @@ impl<'a> PollState<'a> {
7777 debug ! ( "poll done, events: {:?}" , fds[ 0 ] . revents( ) ) ;
7878 match fds[ 0 ] . revents ( ) {
7979 Some ( events) => {
80- if !events. contains ( poll :: EventFlags :: POLLIN ) {
80+ if !events. contains ( PollFlags :: POLLIN ) {
8181 continue ;
8282 }
8383 }
You can’t perform that action at this time.
0 commit comments