diff --git a/applications/test_channel/src/lib.rs b/applications/test_channel/src/lib.rs index ec494dca6b..be91969d6f 100644 --- a/applications/test_channel/src/lib.rs +++ b/applications/test_channel/src/lib.rs @@ -54,7 +54,7 @@ macro_rules! receive_count { () => (RECEIVE_COUNT.load(Ordering::SeqCst)) } -pub fn main(args: Vec) -> isize { +pub fn main(args: Vec) -> isize { let mut opts = Options::new(); opts.optflag("h", "help", "print this help menu"); opts.optflag("v", "verbose", "enable verbose output"); @@ -102,7 +102,7 @@ pub fn main(args: Vec) -> isize { } - match rmain::(matches) { + match rmain(matches) { Ok(_) => 0, Err(e) => { println!("Error: {}", e); @@ -111,7 +111,7 @@ pub fn main(args: Vec) -> isize { } } -fn rmain(matches: Matches) -> Result<(), &'static str> { +fn rmain(matches: Matches) -> Result<(), &'static str> { let mut did_something = false; // If the user has specified panic instances as 'val', 'send_panic_pont' will be 'Some(val)'. @@ -153,12 +153,12 @@ fn rmain(matches: Matches) -> Result<(), &'static str> { if matches.opt_present("o") { did_something = true; println!("Running drop_last_sender test in oneshot mode."); - drop_last_sender_oneshot::()?; + drop_last_sender_oneshot()?; } if matches.opt_present("m") { did_something = true; println!("Running drop_last_sender test in multiple mode."); - drop_last_sender_multiple::()?; + drop_last_sender_multiple()?; } } @@ -166,13 +166,13 @@ fn rmain(matches: Matches) -> Result<(), &'static str> { if matches.opt_present("o") { did_something = true; println!("Running drop_last_receiver test in oneshot mode."); - drop_last_receiver_oneshot::()?; + drop_last_receiver_oneshot()?; } if matches.opt_present("m") { did_something = true; println!("Running drop_last_receiver test in multiple mode."); - drop_last_receiver_multiple::()?; + drop_last_receiver_multiple()?; } } @@ -436,8 +436,8 @@ const USAGE: &'static str = "Usage: test_channel OPTION ARG Provides a selection of different tests for channel-based communication."; /// Create one sender and one receiver. Drop the receiver. Channel should be marked as disconnected. -fn drop_last_sender_oneshot() -> Result<(), &'static str> { - let (sender, receiver) = async_channel::new_channel::(2); +fn drop_last_sender_oneshot() -> Result<(), &'static str> { + let (sender, receiver) = async_channel::new_channel::(2); drop(sender); if receiver.channel_status() != async_channel::ChannelStatus::SenderDisconnected { @@ -449,9 +449,9 @@ fn drop_last_sender_oneshot() -> Result<(), &'static str> { } /// Create two receivers and one sender. Drop the sender. Channel should be marked as disconnected. -fn drop_last_sender_multiple() -> Result<(), &'static str> { +fn drop_last_sender_multiple() -> Result<(), &'static str> { let (sender, receiver) = async_channel::new_channel(2); - let receiver2: async_channel::Receiver = receiver.clone(); + let receiver2: async_channel::Receiver = receiver.clone(); drop(sender); if receiver.channel_status() != async_channel::ChannelStatus::SenderDisconnected { @@ -467,8 +467,8 @@ fn drop_last_sender_multiple() -> Result<(), &'static str> { } /// Create one sender and one receiver. Drop the receiver. Channel should be marked as disconnected. -fn drop_last_receiver_oneshot() -> Result<(), &'static str> { - let (sender, receiver) = async_channel::new_channel::(2); +fn drop_last_receiver_oneshot() -> Result<(), &'static str> { + let (sender, receiver) = async_channel::new_channel::(2); drop(receiver); if sender.channel_status() != async_channel::ChannelStatus::ReceiverDisconnected { @@ -479,9 +479,9 @@ fn drop_last_receiver_oneshot() -> Result<(), &'static str> { } /// Create two senders and one receiver. Drop the receiver. Channel should be marked as disconnected. -fn drop_last_receiver_multiple() -> Result<(), &'static str> { +fn drop_last_receiver_multiple() -> Result<(), &'static str> { let (sender, receiver) = async_channel::new_channel(2); - let sender2: async_channel::Sender = sender.clone(); + let sender2: async_channel::Sender = sender.clone(); drop(receiver); if sender.channel_status() != async_channel::ChannelStatus::ReceiverDisconnected {