From f87aa416f0a3872af16a41e23c5c9c9e1ba8b8eb Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 30 Apr 2018 01:34:00 -0700 Subject: [PATCH] Unquote code in readme --- README.md | 100 +++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index d965161..152da07 100644 --- a/README.md +++ b/README.md @@ -24,59 +24,59 @@ colorized. Install with `pip install Pygments`. ## Example -`$ cat src/main.rs` +#### `$ cat src/main.rs` -> ```rust -> #[derive(Debug)] -> struct S; -> -> fn main() { -> println!("{:?}", S); -> } -> ``` +```rust +#[derive(Debug)] +struct S; -`$ cargo expand` +fn main() { + println!("{:?}", S); +} +``` -> ```rust -> #![feature(prelude_import)] -> #![no_std] -> #[prelude_import] -> use std::prelude::v1::*; -> #[macro_use] -> extern crate std; -> struct S; -> #[automatically_derived] -> #[allow(unused_qualifications)] -> impl ::std::fmt::Debug for S { -> fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { -> match *self { -> S => { -> let mut debug_trait_builder = f.debug_tuple("S"); -> debug_trait_builder.finish() -> } -> } -> } -> } -> -> fn main() { -> ::io::_print(::std::fmt::Arguments::new_v1_formatted( -> &["", "\n"], -> &match (&S,) { -> (arg0,) => [::std::fmt::ArgumentV1::new(arg0, ::std::fmt::Debug::fmt)], -> }, -> &[::std::fmt::rt::v1::Argument { -> position: ::std::fmt::rt::v1::Position::At(0usize), -> format: ::std::fmt::rt::v1::FormatSpec { -> fill: ' ', -> align: ::std::fmt::rt::v1::Alignment::Unknown, -> flags: 0u32, -> precision: ::std::fmt::rt::v1::Count::Implied, -> width: ::std::fmt::rt::v1::Count::Implied, -> }, -> }], -> )); -> } -> ``` +#### `$ cargo expand` + +```rust +#![feature(prelude_import)] +#![no_std] +#[prelude_import] +use std::prelude::v1::*; +#[macro_use] +extern crate std; +struct S; +#[automatically_derived] +#[allow(unused_qualifications)] +impl ::std::fmt::Debug for S { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { + S => { + let mut debug_trait_builder = f.debug_tuple("S"); + debug_trait_builder.finish() + } + } + } +} + +fn main() { + ::io::_print(::std::fmt::Arguments::new_v1_formatted( + &["", "\n"], + &match (&S,) { + (arg0,) => [::std::fmt::ArgumentV1::new(arg0, ::std::fmt::Debug::fmt)], + }, + &[::std::fmt::rt::v1::Argument { + position: ::std::fmt::rt::v1::Position::At(0usize), + format: ::std::fmt::rt::v1::FormatSpec { + fill: ' ', + align: ::std::fmt::rt::v1::Alignment::Unknown, + flags: 0u32, + precision: ::std::fmt::rt::v1::Count::Implied, + width: ::std::fmt::rt::v1::Count::Implied, + }, + }], + )); +} +``` ## Options