diff --git a/README.md b/README.md index 8da0c97..c388147 100644 --- a/README.md +++ b/README.md @@ -13,22 +13,23 @@ According to our benchmarks, it can be faster than ICU. ## Usage -```C++ - std::string_view input = u8"meßagefactory.ca";// non-empty UTF-8 string, must be percent decoded - std::string idna_ascii = ada::idna::to_ascii(input); - if(idna_ascii.empty()) { - // There was an error. - } - std::cout << idna_ascii << std::endl; - // outputs 'xn--meagefactory-m9a.ca' if the input is u8"meßagefactory.ca" +```cpp +std::string_view input = u8"meßagefactory.ca";// non-empty UTF-8 string, must be percent decoded +std::string idna_ascii = ada::idna::to_ascii(input); +if(idna_ascii.empty()) { + // There was an error. +} +std::cout << idna_ascii << std::endl; +// outputs 'xn--meagefactory-m9a.ca' if the input is u8"meßagefactory.ca" ``` ## Benchmarks You may build a benchmarking tool with the library as follows under macOS and Linux: -``` +```bash cmake -D ADA_IDNA_BENCHMARKS=ON -B build +cmake --build build ./build/benchmarks/to_ascii ``` @@ -48,6 +49,8 @@ Icu 2405 ns 2405 ns 299564 speed=29.5213M/s time/byte ### Git hooks +Git hooks are recommended for following our `.clang-format` style. + 1. Install [pre-commit](https://pre-commit.com/) Using [pip](https://www.w3schools.com/python/python_pip.asp):