diff --git a/Cargo.lock b/Cargo.lock index 1a392a644..62844413d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,7 @@ dependencies = [ [[package]] name = "fish-printf" -version = "0.2.0" +version = "0.2.1" dependencies = [ "libc", "widestring", diff --git a/printf/Cargo.toml b/printf/Cargo.toml index 73f574617..cf387ec72 100644 --- a/printf/Cargo.toml +++ b/printf/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fish-printf" edition = "2021" -version = "0.2.0" +version = "0.2.1" repository = "https://github.com/fish-shell/fish-shell" description = "printf implementation, based on musl" license = "MIT" diff --git a/printf/README.md b/printf/README.md index 4ff662905..9a7c07b7b 100644 --- a/printf/README.md +++ b/printf/README.md @@ -10,8 +10,6 @@ Licensed under the MIT license. Run `cargo add fish-printf` to add this crate to your `Cargo.toml` file. -Also run `cargo add widestring` to add the widestring crate. - ### Notes fish-printf attempts to match the C standard for printf. It supports the following features: @@ -27,7 +25,7 @@ The size of integer values is taken from the argument type. fish-printf can output to an `std::fmt::Write` object, or return a string. -For reasons related to fish-shell, fish-printf has a feature "widestring" which uses the [widestring](https://crates.io/crates/widestring) crate. This is off by default. +For reasons related to fish-shell, fish-printf has a feature "widestring" which uses the [widestring](https://crates.io/crates/widestring) crate. This is off by default. If enabled, run `cargo add widestring` to add the widestring crate. ### Examples @@ -38,6 +36,8 @@ use fish_printf::sprintf; let s = sprintf!("%0.5g", 123456.0) // 1.2346e+05 // Append to an existing string. -let s = String::new(); +let mut s = String::new(); sprintf!(=> &mut s, "%0.5g", 123456.0) // 1.2346e+05 ``` + +See the crate documentation for additional examples.