summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2019-10-17 16:16:30 +0200
committerAram Drevekenin <aram@poor.dev>2019-10-17 16:16:30 +0200
commit899c71bcf9b84a283312cec552fc9f49fcd9805d (patch)
tree92b232319a098c5c55b8bd43b49f57038b65f107
parentb226942038908a662e97c5314d96ddcebe8186e0 (diff)
refactor(style): remove unused traits
-rw-r--r--src/main.rs12
-rw-r--r--src/os/linux.rs7
-rw-r--r--src/tests/fakes/fake_input.rs6
3 files changed, 10 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index 33b6bdd..3921a66 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -52,7 +52,7 @@ fn try_main() -> Result<(), failure::Error> {
let stdout = match io::stdout().into_raw_mode() {
Ok(stdout) => stdout,
Err(_) => failure::bail!(
- "Failed to get stdout: what does not (yet) support piping, is it being piped?"
+ "Failed to get stdout: 'what' does not (yet) support piping, is it being piped?"
),
};
let terminal_backend = TermionBackend::new(stdout);
@@ -64,15 +64,15 @@ pub struct OsInput {
pub network_interface: NetworkInterface,
pub network_frames: Box<DataLinkReceiver>,
pub get_open_sockets: fn() -> HashMap<Connection, String>,
- pub keyboard_events: Box<Iterator<Item = Event> + Send + Sync + 'static>,
- pub lookup_addr: Box<Fn(&IpAddr) -> Option<String> + Send + Sync + 'static>,
- pub on_winch: Box<Fn(Box<Fn() + Send + Sync + 'static>) + Send + Sync + 'static>,
- pub cleanup: Box<Fn() + Send + Sync + 'static>,
+ pub keyboard_events: Box<Iterator<Item = Event> + Send>,
+ pub lookup_addr: Box<Fn(&IpAddr) -> Option<String> + Send>,
+ pub on_winch: Box<Fn(Box<Fn()>)+ Send>,
+ pub cleanup: Box<Fn() + Send>,
}
pub fn start<B>(terminal_backend: B, os_input: OsInput)
where
- B: Backend + Send + Sync + 'static,
+ B: Backend + Send + 'static,
{
let running = Arc::new(AtomicBool::new(true));
diff --git a/src/os/linux.rs b/src/os/linux.rs
index 4f326a0..642de38 100644
--- a/src/os/linux.rs
+++ b/src/os/linux.rs
@@ -90,14 +90,11 @@ fn lookup_addr(ip: &IpAddr) -> Option<String> {
::dns_lookup::lookup_addr(ip).ok()
}
-fn sigwinch () -> (
- Box<Fn(Box<Fn() + Send + Sync + 'static>) + Send + Sync + 'static>,
- Box<Fn() + Send + Sync + 'static>
-) {
+fn sigwinch () -> (Box<Fn(Box<Fn()>) + Send>, Box<Fn() + Send>) {
let signals = Signals::new(&[signal_hook::SIGWINCH]).unwrap();
let on_winch = {
let signals = signals.clone();
- move |cb: Box<Fn() + Send + Sync + 'static>| {
+ move |cb: Box<Fn()>| {
for signal in signals.forever() {
match signal {
signal_hook::SIGWINCH => cb(),
diff --git a/src/tests/fakes/fake_input.rs b/src/tests/fakes/fake_input.rs
index 6d76471..1cd5fa4 100644
--- a/src/tests/fakes/fake_input.rs
+++ b/src/tests/fakes/fake_input.rs
@@ -144,16 +144,14 @@ pub fn get_interface() -> NetworkInterface {
pub fn create_fake_lookup_addr(
ips_to_hosts: HashMap<IpAddr, String>,
-) -> Box<Fn(&IpAddr) -> Option<String> + Send + Sync + 'static> {
+) -> Box<Fn(&IpAddr) -> Option<String> + Send> {
Box::new(move |ip| match ips_to_hosts.get(ip) {
Some(host) => Some(host.clone()),
None => None,
})
}
-pub fn create_fake_on_winch(
- should_send_winch_event: bool,
-) -> Box<Fn(Box<Fn() + Send + Sync + 'static>) + Send + Sync + 'static> {
+pub fn create_fake_on_winch(should_send_winch_event: bool) -> Box<Fn(Box<Fn()>) + Send> {
Box::new(move |cb| {
if should_send_winch_event {
thread::sleep(time::Duration::from_secs(1));