Skip to content

Commit 6e73e66

Browse files
committed
update documentation
1 parent 67aeac3 commit 6e73e66

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changes
22

3+
## 4.0.0
4+
5+
- Removed `TryFrom` impls for `&Bytes` and `&[u8]` types. The only conversion
6+
is possible from `&str` now. Changed the validation to use `&str` instead of
7+
`&[u8]`. The main reason I made this change is that it makes no sense to
8+
convert from a ASCII-encoded `&[u8]` not have it as `&str`. The conversion
9+
can alerady be done with `from_utf8()`, no need to repeat it there.
10+
311
## 3.2.0
412

513
### Improvements

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[package]
2-
edition = "2021"
3-
name = "trid"
4-
version = "3.2.0"
5-
description = "Turkish citizenship ID number type"
6-
readme = "README.md"
7-
homepage = "https://github.com/ssg/trid"
8-
repository = "https://github.com/ssg/trid"
9-
authors = ["Sedat Kapanoglu <sedat@kapanoglu.com>"]
10-
license = "Apache-2.0"
11-
keywords = ["turkish", "turkey", "id", "number"]
12-
categories = ["parser-implementations"]
1+
[package]
2+
edition = "2021"
3+
name = "trid"
4+
version = "4.0.0"
5+
description = "Turkish citizenship ID number type"
6+
readme = "README.md"
7+
homepage = "https://github.com/ssg/trid"
8+
repository = "https://github.com/ssg/trid"
9+
authors = ["Sedat Kapanoglu <sedat@kapanoglu.com>"]
10+
license = "Apache-2.0"
11+
keywords = ["turkish", "turkey", "id", "number"]
12+
categories = ["parser-implementations"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
# trid - Turkish Citizenship ID Number crate
55

66
This is my first ever written Rust code derived from my own [TurkishId](https://github.com/ssg/TurkishId)
7-
package for .NET. I'm trying to use existing code as an excuse to learn about Rust. Despite constant tackling
8-
with error messages, Rust has been extremely impressive so far. (How cool are doc-tests!?)
7+
package for .NET. I'm trying to use existing code as an excuse to learn about Rust. Despite constant tackling with error messages, Rust has been extremely impressive so far. (How cool are doc-tests!?)
98

109
# Usage
1110

1211
The crate provides `TurkishId` type that represents a valid Turkish ID number. It can be instantiated
13-
from a string using its `parse()` method, or directly converted from a `u8` slice using `from()` or
14-
`try_from()` methods. The type guarantess that it never contains an invalid number, so there's no need
15-
to validate a `TurkishId` type.
12+
from a string using the `parse()` method of `str` type. `TurkishId` type guarantess that it never contains an invalid Turkish ID number, so there's no need to validate a `TurkishId` once parsed. It
13+
can always be passed around.
1614

1715
The crate also provides `is_valid(value: &str)` function for validating ID numbers.
1816

17+
The type occupies 11 bytes in memory and kept as ASCII representation of the number.
18+
1919
# Examples
2020

2121
Validate a Turkish citizenship ID number:

0 commit comments

Comments
 (0)