From d98b782925c028511a6152de1c0e2c0c90a5a8eb Mon Sep 17 00:00:00 2001 From: Alicja Date: Tue, 16 Jun 2020 21:18:53 +0200 Subject: [PATCH] Make docs consistent --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 7 ++++--- src/lib.rs | 18 ++++++++++-------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa02a47..8a76c8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -309,7 +309,7 @@ checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "urbit-q" -version = "0.2.0" +version = "0.2.1" dependencies = [ "phf", "proptest", diff --git a/Cargo.toml b/Cargo.toml index 301f87f..de0d4a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "urbit-q" -version = "0.2.0" +version = "0.2.1" authors = ["k2l8m11n2"] edition = "2018" description = "Encode and decode data in Urbit's @q format" diff --git a/README.md b/README.md index a21f924..c80567f 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,14 @@ [![](https://travis-ci.org/k2l8m11n2/urbit-q.svg?branch=master)](https://travis-ci.org/github/k2l8m11n2/urbit-q) -Based on [urbit-ob](https://github.com/urbit/urbit-ob), supports only the `@q` format. +Based on [urbit-ob](https://github.com/urbit/urbit-ob), supports only the `@q` +format. ## usage Note that when encoding more than one byte, `encode` pads from the beginning to -an even number (as per the original implementation) and `decode` ignores any -dashes or spaces within the string. +an even number of bytes (as per the original implementation) and `decode` +ignores any dashes or spaces within the string. ```rust urbit_q::encode(&[1]); // nec let string = urbit_q::encode(&[1, 2, 3]); // doznec-binwes diff --git a/src/lib.rs b/src/lib.rs index 6c0e641..4229339 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,13 @@ //! # urbit-q //! -//! Based on [urbit-ob](https://github.com/urbit/urbit-ob), supports only the `@q` format. +//! Based on [urbit-ob](https://github.com/urbit/urbit-ob), supports only the +//! `@q` format. //! //! ## usage //! -//! Note that when encoding more than one byte, `encode` pads from the beginning to -//! an even number (as per the original implementation) and `decode` ignores any -//! dashes or spaces within the string. +//! Note that when encoding more than one byte, `encode` pads from the beginning +//! to an even number of bytes (as per the original implementation) and `decode` +//! ignores any dashes or spaces within the string. //! ```rust //! urbit_q::encode(&[1]); // nec //! let string = urbit_q::encode(&[1, 2, 3]); // doznec-binwes @@ -20,12 +21,13 @@ mod consts; /// Encodes data to Urbit's `@q` format /// -/// Note that it pads the beginning to an even number of bytes (as per the -/// original implementation, [urbit-ob](https://github.com/urbit/urbit-ob)), e.g. +/// Note that when encoding more than one byte, it pads from the beginning to +/// an even number of bytes (as per the original implementation, +/// [urbit-ob](https://github.com/urbit/urbit-ob)), e.g. /// ``` /// # use urbit_q::*; -/// let bytes: [u8; 3] = [1, 2, 3]; -/// let string = encode(&bytes); // doznec-binwes +/// encode(&[1]); // nec +/// let string = encode(&[1, 2, 3]); // doznec-binwes /// decode(&string).unwrap(); // [0, 1, 2, 3] /// ``` pub fn encode(input: &[u8]) -> String {