Skip to content

Commit

Permalink
Cleanup and versioning update for 2.0.0 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielSanchezQ authored Sep 11, 2024
1 parent 8602df6 commit 432945c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
31 changes: 0 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,6 @@ if __name__ == "__main__":

You can find more examples in the `/examples` folder.

## Pydantic
Option and Result are fully compatible with [pydantic](https://pydantic-docs.helpmanual.io/) models

```python
import pydantic
from rusty_results import Option, Some, Empty


class MyData(pydantic.BaseModel):
name: Option[str]
phone: Option[int]


if __name__ == "__main__":
import json
# serialize to json
json_data = MyData(name=Some("Link"), phone=Empty()).json()
print(json_data)
# deserialize json data
data = MyData(**json.loads(json_data))
print(data)

```

prints out:

```shell
{"name": {"Some": "Link"}, "phone": {}}
name=Some(Some='Link') phone=Empty()
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="rusty-results",
version="1.1.1",
version="2.0.0",
author="Daniel Sanchez Quiros, Antonio Jose Checa Bustos",
author_email="[email protected], [email protected]",
description="Rust inspired Result and Option types",
Expand Down

0 comments on commit 432945c

Please sign in to comment.