From 2b7b85714d365a773ddc39a0fbbaee05a52a1339 Mon Sep 17 00:00:00 2001 From: francium Date: Mon, 12 Feb 2024 18:57:11 -0500 Subject: [PATCH] fix: update references to main branch --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 2 +- Makefile | 2 +- README.md | 6 +-- docs/result.md | 106 +++++++++++++++++++-------------------- 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea20cf8..8cab7cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ on: push: branches: - - master + - main pull_request: name: CI diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb872a..0b87af1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -137,7 +137,7 @@ codebase. - Initial version -[MIGRATING.md]: https://github.com/rustedpy/result/blob/master/MIGRATING.md +[MIGRATING.md]: https://github.com/rustedpy/result/blob/main/MIGRATING.md [Unreleased]: https://github.com/rustedpy/result/compare/v0.16.0...HEAD [0.16.0]: https://github.com/rustedpy/result/compare/v0.15.0...v0.16.0 [0.15.0]: https://github.com/rustedpy/result/compare/v0.14.0...v0.15.0 diff --git a/Makefile b/Makefile index 840bfc9..d8df00b 100644 --- a/Makefile +++ b/Makefile @@ -27,5 +27,5 @@ test: phony docs: phony lazydocs \ --overview-file README.md \ - --src-base-url https://github.com/rustedpy/result/blob/master/ \ + --src-base-url https://github.com/rustedpy/result/blob/main/ \ ./src/result diff --git a/README.md b/README.md index 0c377ae..0b6aff0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Result -[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/rustedpy/result/ci.yml?branch=master)](https://github.com/rustedpy/result/actions/workflows/ci.yml?query=branch%3Amaster) -[![Coverage](https://codecov.io/gh/rustedpy/result/branch/master/graph/badge.svg)](https://codecov.io/gh/rustedpy/result) +[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/rustedpy/result/ci.yml?branch=main)](https://github.com/rustedpy/result/actions/workflows/ci.yml?query=branch%3Amaster) +[![Coverage](https://codecov.io/gh/rustedpy/result/branch/main/graph/badge.svg)](https://codecov.io/gh/rustedpy/result) A simple Result type for Python 3 [inspired by Rust](https://doc.rust-lang.org/std/result/), fully type annotated. @@ -14,7 +14,7 @@ Latest release: $ pip install result ``` -Latest GitHub `master` branch version: +Latest GitHub `main` branch version: ``` sh $ pip install git+https://github.com/rustedpy/result diff --git a/docs/result.md b/docs/result.md index f156878..e3ee642 100644 --- a/docs/result.md +++ b/docs/result.md @@ -1,6 +1,6 @@ - + # module `result` @@ -13,7 +13,7 @@ --- - + ## function `as_result` @@ -30,7 +30,7 @@ Regular return values are turned into ``Ok(return_value)``. Raised exceptions of --- - + ## function `as_async_result` @@ -45,7 +45,7 @@ Make a decorator to turn an async function into one that returns a ``Result``. R --- - + ## function `is_ok` @@ -68,7 +68,7 @@ elif is_err(r): --- - + ## function `is_err` @@ -91,7 +91,7 @@ elif is_err(r): --- - + ## function `do` @@ -128,7 +128,7 @@ NOTE: If you exclude the type annotation e.g. `Result[float, int]` your type che --- - + ## function `do_async` @@ -182,12 +182,12 @@ Furthermore, neither mypy nor pyright can infer that the second case is actually --- - + ## class `Ok` A value that indicates success and which stores arbitrary data for the return value. - + ### method `__init__` @@ -218,7 +218,7 @@ Return the inner value. --- - + ### method `and_then` @@ -230,7 +230,7 @@ The contained result is `Ok`, so return the result of `op` with the original val --- - + ### method `and_then_async` @@ -242,7 +242,7 @@ The contained result is `Ok`, so return the result of `op` with the original val --- - + ### method `err` @@ -254,7 +254,7 @@ Return `None`. --- - + ### method `expect` @@ -266,7 +266,7 @@ Return the value. --- - + ### method `expect_err` @@ -278,7 +278,7 @@ Raise an UnwrapError since this type is `Ok` --- - + ### method `is_err` @@ -292,7 +292,7 @@ is_err() → Literal[False] --- - + ### method `is_ok` @@ -306,7 +306,7 @@ is_ok() → Literal[True] --- - + ### method `map` @@ -318,7 +318,7 @@ The contained result is `Ok`, so return `Ok` with original value mapped to a new --- - + ### method `map_async` @@ -330,7 +330,7 @@ The contained result is `Ok`, so return the result of `op` with the original val --- - + ### method `map_err` @@ -342,7 +342,7 @@ The contained result is `Ok`, so return `Ok` with the original value --- - + ### method `map_or` @@ -354,7 +354,7 @@ The contained result is `Ok`, so return the original value mapped to a new value --- - + ### method `map_or_else` @@ -366,7 +366,7 @@ The contained result is `Ok`, so return original value mapped to a new value usi --- - + ### method `ok` @@ -378,7 +378,7 @@ Return the value. --- - + ### method `or_else` @@ -390,7 +390,7 @@ The contained result is `Ok`, so return `Ok` with the original value --- - + ### method `unwrap` @@ -402,7 +402,7 @@ Return the value. --- - + ### method `unwrap_err` @@ -414,7 +414,7 @@ Raise an UnwrapError since this type is `Ok` --- - + ### method `unwrap_or` @@ -426,7 +426,7 @@ Return the value. --- - + ### method `unwrap_or_else` @@ -438,7 +438,7 @@ Return the value. --- - + ### method `unwrap_or_raise` @@ -451,12 +451,12 @@ Return the value. --- - + ## class `DoException` This is used to signal to `do()` that the result is an `Err`, which short-circuits the generator and returns that Err. Using this exception for control flow in `do()` allows us to simulate `and_then()` in the Err case: namely, we don't call `op`, we just return `self` (the Err). - + ### method `__init__` @@ -474,12 +474,12 @@ __init__(err: 'Err[E]') → None --- - + ## class `Err` A value that signifies failure and which stores arbitrary data for the error. - + ### method `__init__` @@ -510,7 +510,7 @@ Return the inner value. --- - + ### method `and_then` @@ -522,7 +522,7 @@ The contained result is `Err`, so return `Err` with the original value --- - + ### method `and_then_async` @@ -534,7 +534,7 @@ The contained result is `Err`, so return `Err` with the original value --- - + ### method `err` @@ -546,7 +546,7 @@ Return the error. --- - + ### method `expect` @@ -558,7 +558,7 @@ Raises an `UnwrapError`. --- - + ### method `expect_err` @@ -570,7 +570,7 @@ Return the inner value --- - + ### method `is_err` @@ -584,7 +584,7 @@ is_err() → Literal[True] --- - + ### method `is_ok` @@ -598,7 +598,7 @@ is_ok() → Literal[False] --- - + ### method `map` @@ -610,7 +610,7 @@ Return `Err` with the same value --- - + ### method `map_async` @@ -622,7 +622,7 @@ The contained result is `Ok`, so return the result of `op` with the original val --- - + ### method `map_err` @@ -634,7 +634,7 @@ The contained result is `Err`, so return `Err` with original error mapped to a n --- - + ### method `map_or` @@ -646,7 +646,7 @@ Return the default value --- - + ### method `map_or_else` @@ -658,7 +658,7 @@ Return the result of the default operation --- - + ### method `ok` @@ -670,7 +670,7 @@ Return `None`. --- - + ### method `or_else` @@ -682,7 +682,7 @@ The contained result is `Err`, so return the result of `op` with the original va --- - + ### method `unwrap` @@ -694,7 +694,7 @@ Raises an `UnwrapError`. --- - + ### method `unwrap_err` @@ -706,7 +706,7 @@ Return the inner value --- - + ### method `unwrap_or` @@ -718,7 +718,7 @@ Return `default`. --- - + ### method `unwrap_or_else` @@ -730,7 +730,7 @@ The contained result is ``Err``, so return the result of applying ``op`` to the --- - + ### method `unwrap_or_raise` @@ -743,14 +743,14 @@ The contained result is ``Err``, so raise the exception with the value. --- - + ## class `UnwrapError` Exception raised from ``.unwrap_<...>`` and ``.expect_<...>`` calls. The original ``Result`` can be accessed via the ``.result`` attribute, but this is not intended for regular use, as type information is lost: ``UnwrapError`` doesn't know about both ``T`` and ``E``, since it's raised from ``Ok()`` or ``Err()`` which only knows about either ``T`` or ``E``, not both. - + ### method `__init__`