introduce UuidError for general Uuid use #284

Merged
kinggoesgaming merged 4 commits from uuid_error into breaking 2018-07-24 03:49:45 -05:00
kinggoesgaming commented 2018-07-23 14:17:15 -05:00 (Migrated from github.com)

I'm submitting a(n) feature, refactor

Description

  • Introduce a ::UuidError type.
  • Change signature of ::Uuid::from_fields, ::Uuid::new_v1 and ::Uuid::from_bytes to use the new error type.

This now splits the Uuid creation types into 3 categories:

  • those which have no errors for creating
  • those which throw errors based around parsing (currently ParseError)
  • those which throw errors based around bytes (UuidError)

Motivation

ParseError is oriented around parsing uuid strings. However, that error type does not bode well functions that are accepting bytes.

Tests

All current tests pass with the signature change. No new tests added

Related Issue(s)

closes #281

**I'm submitting a(n)** feature, refactor # Description * Introduce a `::UuidError` type. * Change signature of `::Uuid::from_fields`, `::Uuid::new_v1` and `::Uuid::from_bytes` to use the new error type. This now splits the `Uuid` creation types into 3 categories: * those which have no errors for creating * those which throw errors based around parsing (currently `ParseError`) * those which throw errors based around bytes (`UuidError`) # Motivation `ParseError` is oriented around parsing uuid strings. However, that error type does not bode well functions that are accepting bytes. # Tests All current tests pass with the signature change. No new tests added # Related Issue(s) closes #281
radix (Migrated from github.com) reviewed 2018-07-23 14:17:15 -05:00
KodrAus (Migrated from github.com) reviewed 2018-07-23 14:17:15 -05:00
Dylan-DPC-zz (Migrated from github.com) approved these changes 2018-07-24 03:42:35 -05:00
Dylan-DPC-zz commented 2018-07-24 03:42:44 -05:00 (Migrated from github.com)

bors: r+

bors: r+
bors[bot] commented 2018-07-24 03:49:44 -05:00 (Migrated from github.com)
# Build succeeded * [continuous-integration/travis-ci/push](https://travis-ci.org/uuid-rs/uuid/builds/407508075?utm_source=github_status&utm_medium=notification) * [continuous-integration/appveyor/branch](https://ci.appveyor.com/project/KodrAus/uuid/build/1.0.786)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid!284
No description provided.