From 65808b4e498050a22648523def32e070a4074678 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Thu, 6 Dec 2018 23:36:28 -0500 Subject: [PATCH] Minor docs update --- Makefile | 2 +- README.md | 17 ++++++++--------- src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 16d0d47..8fc2aa7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ readme: README.md README.md: src/lib.rs @sed -i '/---/q' README.md - @cat src/lib.rs | grep '//!' | sed 's/^\/\/\! *//g' >> README.md + @cat src/lib.rs | grep '//!' | sed -E 's/^\/\/\! ?//g' >> README.md .PHONY: doc doc: readme contributors diff --git a/README.md b/README.md index 30d8f73..52790f5 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,8 @@ [![travisci](https://travis-ci.org/bspeice/qadapt.svg?branch=master)](https://travis-ci.org/bspeice/qadapt) [![appveyor](https://ci.appveyor.com/api/projects/status/km1p081tkjcptn1w/branch/master?svg=true)](https://ci.appveyor.com/project/bspeice/qadapt/branch/master) - --- -# QADAPT - `debug_assert!` for your memory +## `debug_assert!` for your memory usage This allocator is a helper for writing high-performance code that is memory-sensitive; a thread panic will be triggered if a function annotated with `#[no_alloc]`, @@ -42,7 +41,7 @@ use qadapt::no_alloc; #[no_alloc] fn do_math() -> u8 { -2 + 2 + 2 + 2 } ``` @@ -51,10 +50,10 @@ fn do_math() -> u8 { use qadapt::assert_no_alloc; fn do_work() { -// This code is allowed to trigger an allocation -let b = Box::new(8); - -// This code would panic if an allocation occurred inside it -let x = assert_no_alloc!(*b + 2); -assert_eq!(x, 10); + // This code is allowed to trigger an allocation + let b = Box::new(8); + + // This code would panic if an allocation occurred inside it + let x = assert_no_alloc!(*b + 2); + assert_eq!(x, 10); } diff --git a/src/lib.rs b/src/lib.rs index b2bf213..94a6b36 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! # QADAPT - `debug_assert!` for your memory +//! ## `debug_assert!` for your memory usage //! //! This allocator is a helper for writing high-performance code that is memory-sensitive; //! a thread panic will be triggered if a function annotated with `#[no_alloc]`,