Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dff60d3

Browse files
committedJul 23, 2017
Remove dead code and mark conditionally-dead code
1 parent dce8ece commit dff60d3

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed
 

‎src/platform/macos/events_loop/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::sync::{Arc, Mutex, Weak};
55
use super::window::{self, Window};
66

77
mod nsevent;
8-
mod timer;
98

109
// Simple blocking runloop
1110
#[cfg(not(feature="context"))]
@@ -16,6 +15,10 @@ mod runloop;
1615
#[path="runloop_context.rs"]
1716
mod runloop;
1817

18+
// NSTimer wrapper, needed only for coroutine-baesd runloop
19+
#[cfg(feature="context")]
20+
mod timer;
21+
1922
use self::runloop::Runloop;
2023

2124
pub struct EventsLoop {
@@ -54,6 +57,7 @@ impl Shared {
5457
}
5558

5659
// Are there any events pending delivery?
60+
#[allow(dead_code)]
5761
fn has_queued_events(&self) -> bool {
5862
!self.pending_events.lock().unwrap().is_empty()
5963
}

‎src/platform/macos/events_loop/nsevent.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ impl RetainedEvent {
1818
unsafe { CFRetain(event as CFTypeRef); }
1919
RetainedEvent(event)
2020
}
21-
pub fn into_inner(self) -> cocoa::base::id {
22-
self.0
23-
}
2421
pub fn id(&self) -> cocoa::base::id {
2522
self.0
2623
}
@@ -116,6 +113,7 @@ impl Modifiers {
116113
//
117114
// The event itself corresponds to no `Event`, but it does cause `receive_event_from_cocoa()` to
118115
// return to its caller.
116+
#[allow(dead_code)]
119117
pub fn post_event_to_self() {
120118
unsafe {
121119
let pool = foundation::NSAutoreleasePool::new(cocoa::base::nil);

‎src/platform/macos/events_loop/runloop.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::sync::Weak;
22
use core_foundation;
3-
use cocoa::{self, foundation};
4-
use cocoa::appkit::{self, NSApplication, NSApp};
3+
use cocoa;
54

65
use super::{Shared,Timeout};
76
use super::nsevent;

‎src/platform/macos/events_loop/runloop_context.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use context;
55
use core_foundation;
66
use core_foundation::base::*;
77
use core_foundation::runloop::*;
8-
use cocoa::{self, foundation};
9-
use cocoa::appkit::{self, NSApplication, NSApp};
8+
use cocoa;
109
use libc::c_void;
1110

1211
use super::{Shared,Timeout};

‎src/platform/macos/events_loop/timer.rs

-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl Timer {
2828
// default to firing every year, starting one year in the future
2929
let interval: CFTimeInterval = interval_seconds;
3030
let now = unsafe { CFAbsoluteTimeGetCurrent() };
31-
let next_interval = now + interval;
3231

3332
let mut context: CFRunLoopTimerContext = unsafe { mem::zeroed() };
3433

@@ -54,13 +53,6 @@ impl Timer {
5453
timer
5554
}
5655
}
57-
58-
// Cause the timer to fire ASAP. Can be called across threads.
59-
pub fn trigger(&self) {
60-
unsafe {
61-
CFRunLoopTimerSetNextFireDate(self.timer, CFAbsoluteTimeGetCurrent());
62-
}
63-
}
6456
}
6557

6658
impl Drop for Timer {

0 commit comments

Comments
 (0)
Please sign in to comment.