<commit_before># Minimal Rust project to access the [commercetools platform](http://dev.commercetools.com/) API.

This project contains:

- a mini-library `commercetools` that could evolve into a real SDK in the future
- examples using the mini-library

## Sphere library

The `commercetools` library contains the module [`commercetools::auth`](/rust/src/auth.rs), used to retrieve an [access token](http://dev.commercetools.com/http-api-authorization.html) to use the API.

This library follows the Rust standard:

- unit tests are found next to the implementation.
- integration tests are found in ['/tests'](/rust/tests).
- code is formatted with [rustfmt](https://github.com/rust-lang-nursery/rustfmt).

## Prerequisites

[Rust](https://www.rust-lang.org/) and [Cargo](https://crates.io/install) must be installed. We advise you to use [rustup](https://github.com/rust-lang-nursery/rustup.rs) to install them.

## Hack
### Run the tests
```
cargo test
```

### Generate the documentation
```
cargo doc
```
The documentation is available in `target/doc/commercetools`.

### Format the code
Only once:
```<commit_msg>add openssl dependency<commit_after># Minimal Rust project to access the [commercetools platform](http://dev.commercetools.com/) API.

This project contains:

- a mini-library `commercetools` that could evolve into a real SDK in the future
- examples using the mini-library

## Sphere library

The `commercetools` library contains the module [`commercetools::auth`](/rust/src/auth.rs), used to retrieve an [access token](http://dev.commercetools.com/http-api-authorization.html) to use the API.

This library follows the Rust standard:

- unit tests are found next to the implementation.
- integration tests are found in ['/tests'](/rust/tests).
- code is formatted with [rustfmt](https://github.com/rust-lang-nursery/rustfmt).

## Prerequisites

[Rust](https://www.rust-lang.org/) and [Cargo](https://crates.io/install) must be installed. We advise you to use [rustup](https://github.com/rust-lang-nursery/rustup.rs) to install them.

#### On mac:

install openssl:
```
brew install openssl
```

and export the lib:
```
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
```

## Hack
### Run the tests
```
cargo test
```

### Generate the documentation
```
cargo doc
```
The documentation is available in `target/doc/commercetools`.

### Format the code
Only once:
```
{'fraction_non_alphanumeric': 0.13569937369519833, 'fraction_numerical': 0.0, 'mean_word_length': 4.585081585081585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4960424', 'n_tokens_mistral': 781, 'n_tokens_neox': 745, 'n_words': 239}