-
Notifications
You must be signed in to change notification settings - Fork 11
refactor!: remove exn::Error #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,20 +88,6 @@ pub use self::option::OptionExt; | |
| pub use self::result::Result; | ||
| pub use self::result::ResultExt; | ||
|
|
||
| /// A trait bound of the supported error type of [`Exn`]. | ||
| pub trait Error: std::error::Error + std::any::Any + Send + Sync + 'static { | ||
| /// Raise this error as a new exception. | ||
| #[track_caller] | ||
| fn raise(self) -> Exn<Self> | ||
| where | ||
| Self: Sized, | ||
| { | ||
| Exn::new(self) | ||
| } | ||
| } | ||
|
|
||
| impl<T> Error for T where T: std::error::Error + std::any::Any + Send + Sync + 'static {} | ||
|
|
||
| /// Equivalent to `Ok::<_, Exn<E>>(value)`. | ||
| /// | ||
| /// This simplifies creation of an `exn::Result` in places where type inference cannot deduce the | ||
|
|
@@ -119,6 +105,6 @@ impl<T> Error for T where T: std::error::Error + std::any::Any + Send + Sync + ' | |
| /// | consider giving this pattern the explicit type `std::result::Result<i32, E>`, where the type parameter `E` is specified | ||
| /// ``` | ||
| #[expect(non_snake_case)] | ||
| pub fn Ok<T, E: Error>(value: T) -> Result<T, E> { | ||
| pub fn Ok<T, E: std::error::Error + 'static>(value: T) -> Result<T, E> { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in the Perhaps we can move this function to a new file and |
||
| Result::Ok(value) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.