aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/window/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index f4c296a..b89e34c 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -519,8 +519,7 @@ impl Window {
mem::transmute(buffer.as_mut_ptr()),
buffer.len() as libc::c_int, ptr::null_mut(), ptr::null_mut());
- str::from_utf8(buffer.as_slice().slice_to(count as usize))
- .unwrap_or("").to_string()
+ str::from_utf8(&buffer.as_slice()[..count as usize]).unwrap_or("").to_string()
};
for chr in written.as_slice().chars() {