aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs4
-rw-r--r--src/win32/callback.rs5
-rw-r--r--src/win32/mod.rs8
-rw-r--r--src/x11/window/mod.rs2
-rw-r--r--src/x11/window/monitor.rs2
5 files changed, 14 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 916b699..1776541 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -211,7 +211,9 @@ pub struct PixelFormat {
}
/// Attributes
-struct BuilderAttribs<'a> {
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct BuilderAttribs<'a> {
#[allow(dead_code)]
headless: bool,
strict: bool,
diff --git a/src/win32/callback.rs b/src/win32/callback.rs
index 5423fc3..f9ec653 100644
--- a/src/win32/callback.rs
+++ b/src/win32/callback.rs
@@ -36,8 +36,9 @@ fn send_event(input_window: winapi::HWND, event: Event) {
/// This is the callback that is called by `DispatchMessage` in the events loop.
///
/// Returning 0 tells the Win32 API that the message has been processed.
-pub extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
- wparam: winapi::WPARAM, lparam: winapi::LPARAM) -> winapi::LRESULT
+pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
+ wparam: winapi::WPARAM, lparam: winapi::LPARAM)
+ -> winapi::LRESULT
{
match msg {
winapi::WM_DESTROY => {
diff --git a/src/win32/mod.rs b/src/win32/mod.rs
index 8ba5ed5..07f76e8 100644
--- a/src/win32/mod.rs
+++ b/src/win32/mod.rs
@@ -49,7 +49,9 @@ unsafe impl Send for Window {}
unsafe impl Sync for Window {}
/// A simple wrapper that destroys the context when it is destroyed.
-struct ContextWrapper(pub winapi::HGLRC);
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct ContextWrapper(pub winapi::HGLRC);
impl Drop for ContextWrapper {
fn drop(&mut self) {
@@ -60,7 +62,9 @@ impl Drop for ContextWrapper {
}
/// A simple wrapper that destroys the window when it is destroyed.
-struct WindowWrapper(pub winapi::HWND, pub winapi::HDC);
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct WindowWrapper(pub winapi::HWND, pub winapi::HDC);
impl Drop for WindowWrapper {
fn drop(&mut self) {
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index 7845d07..385a913 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -348,7 +348,7 @@ impl Window {
return Err(OsError(format!("Could not query the video modes")));
}
- for i in range(0, mode_num) {
+ for i in 0..mode_num {
let mode: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _);
if mode.hdisplay == dimensions.0 as u16 && mode.vdisplay == dimensions.1 as u16 {
best_mode = i;
diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs
index 77ac4ec..1dc0350 100644
--- a/src/x11/window/monitor.rs
+++ b/src/x11/window/monitor.rs
@@ -18,7 +18,7 @@ pub fn get_available_monitors() -> VecDeque<MonitorID> {
};
let mut monitors = VecDeque::new();
- monitors.extend(range(0, nb_monitors).map(|i| MonitorID(i as u32)));
+ monitors.extend((0..nb_monitors).map(|i| MonitorID(i as u32)));
monitors
}