From b633b29b6c37afed57cadf8d51a55a775d1c8968 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 2 May 2016 15:03:24 +0200 Subject: [PATCH] Fix rendering of `repr(C)` Fixes #151 --- blog/post/2015-10-23-printing-to-screen.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/post/2015-10-23-printing-to-screen.md b/blog/post/2015-10-23-printing-to-screen.md index b190241b..bc9480d0 100644 --- a/blog/post/2015-10-23-printing-to-screen.md +++ b/blog/post/2015-10-23-printing-to-screen.md @@ -125,9 +125,9 @@ struct Buffer { chars: [[ScreenChar; BUFFER_WIDTH]; BUFFER_HEIGHT], } ``` -Since the field ordering in default structs is undefined in Rust, we need the [repr(C)] attribute. It guarantees that the struct's fields are laid out exactly like in a C struct and thus guarantees the correct field ordering. +Since the field ordering in default structs is undefined in Rust, we need the [repr(C\)] attribute. It guarantees that the struct's fields are laid out exactly like in a C struct and thus guarantees the correct field ordering. -[repr(C)]: https://doc.rust-lang.org/nightly/nomicon/other-reprs.html#reprc +[repr(C\)]: https://doc.rust-lang.org/nightly/nomicon/other-reprs.html#reprc To actually write to screen, we now create a writer type: