Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matklad/format-buf


https://github.com/matklad/format-buf

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/matklad/format-buf.svg?branch=master)](https://travis-ci.org/matklad/format-buf)
[![Crates.io](https://img.shields.io/crates/v/format-buf.svg)](https://crates.io/crates/format-buf)
[![API reference](https://docs.rs/format-buf/badge.svg)](https://docs.rs/format-buf/)

# Overview

A drop-in replacement for `std::format!`, which can optionally accept an
existing `String` buffer.

```rust
use format_buf::format;

let mut buf = format!("Roses are {},\n", "red");
let () = format!(buf, "Violets are {}.", "blue");
assert_eq!(buf, "\
Roses are red,\n\
Violets are blue.\
")