Skip to content

v0.7.0

Pre-release
Pre-release

Choose a tag to compare

@megascrapper megascrapper released this 05 Feb 01:44
· 7 commits to master since this release
ac17ab5

Changes

Library

  • Completely overhauled the API by decoupling the request methods from the response structs
  • Add is_odd top level function and isodd() method in IsEvenApiResponse (formerly IsEven)
  • Improved error handling by separating error types thrown by the API
  • Improved names for structs etc
  • Updated dependencies
  • Other internal code & test refactoring
  • Add derive traits to IsEvenApiResponse and IsEvenApiErrorResponse
  • Add crate feature blocking for blocking code

CLI app

  • Add raw JSON output
  • Accept multiple inputs on CLI app
  • Make CLI-only dependencies optional behind the cli cargo feature

Breaking changes

Please note that this version has a lot of breaking changes. Some things to consider:

  • IsEven::get and IsEven::get_blocking has been replaced by IsEvenApiClient::get and IsEvenApiBlockingClient::get respectively. Note that the clients must be instantiated first before it's ready to use.

Example code migration:

v0.6.0

use iseven_api::IsEven;
let even_num = IsEven::get(42).await?;

v0.7.0

use iseven_api::IsEvenApiClient;

// Initialise the client
let client = IsEvenApiClient::new();

// Make requests
let even_num = client.get(42).await?;
  • Struct and enum names have changed:
    • IsEven -> IsEvenApiResponse
    • ErrorResponse -> IsEvenApiErrorResponse
    • IsEvenError -> IsEvenApiError
  • The enum variant IsEvenError::ErrorResponse has been split into 3 in IsEvenApiError:
    • NumberOutOfRange
    • InvalidNumber
    • UnknownErrorResponse - for errors that don't fit in the above categories
  • All blocking functionalities are now locked behind blocking feature. To enable them, pass --features blocking or --all-features to cargo
  • CLI app is now locked behind cli feature.