You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,18 @@
4
4
# trid - Turkish Citizenship ID Number crate
5
5
6
6
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!?)
9
8
10
9
# Usage
11
10
12
11
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.
16
14
17
15
The crate also provides `is_valid(value: &str)` function for validating ID numbers.
18
16
17
+
The type occupies 11 bytes in memory and kept as ASCII representation of the number.
0 commit comments