aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/headless.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11/headless.rs')
-rw-r--r--src/x11/headless.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/x11/headless.rs b/src/x11/headless.rs
index 22d0654..b4a6ba0 100644
--- a/src/x11/headless.rs
+++ b/src/x11/headless.rs
@@ -19,7 +19,7 @@ impl HeadlessContext {
Ok(HeadlessContext {
width: dimensions.0,
height: dimensions.1,
- buffer: Vec::from_elem(dimensions.0 * dimensions.1, unsafe { mem::uninitialized() }),
+ buffer: ::std::iter::repeat(unsafe { mem::uninitialized() }).take(dimensions.0 * dimensions.1).collect(),
context: unsafe {
let ctxt = ffi::OSMesaCreateContext(0x1908, ptr::null());
if ctxt.is_null() {