From 313634334886299ee23bda42e43cfa956057e31e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 5 Apr 2014 16:35:05 +0200 Subject: [PATCH 1/2] Update to current rust: &[T]::map is gone. --- gl2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl2.rs b/gl2.rs index 5f77af2..ae57305 100644 --- a/gl2.rs +++ b/gl2.rs @@ -888,8 +888,8 @@ pub fn scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { } pub fn shader_source(shader: GLuint, strings: &[&[u8]]) { - let pointers = strings.map(|string| (*string).as_ptr()); - let lengths = strings.map(|string| string.len() as GLint); + let pointers: ~[*u8] = strings.iter().map(|string| (*string).as_ptr()).collect(); + let lengths: ~[GLint] = strings.iter().map(|string| string.len() as GLint).collect(); unsafe { glShaderSource(shader, pointers.len() as GLsizei, pointers.as_ptr() as **GLchar, lengths.as_ptr()); From baa8865c5655af1039e4771f20d928f46c89fbc3 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 5 Apr 2014 16:35:48 +0200 Subject: [PATCH 2/2] Update to current rust: struct fields are private by default. --- glx.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glx.rs b/glx.rs index 7e4bfd2..e6d257e 100644 --- a/glx.rs +++ b/glx.rs @@ -14,13 +14,13 @@ use std::libc::{c_char, c_int, c_ulong}; // Types pub struct Display { - priv opaque: (), + opaque: (), } pub type GLXDrawable = c_ulong; pub struct __GLXFBConfig { - priv opaque: (), + opaque: (), } pub type GLXFBConfig = *__GLXFBConfig; @@ -30,7 +30,7 @@ pub type GLXPixmap = c_ulong; pub type Pixmap = c_ulong; pub struct __XVisualInfo { - priv opaque: (), + opaque: (), } pub type XVisualInfo = *__XVisualInfo;