Skip to content

Commit

Permalink
refactor: add #[non_exhaustive] attributes to enums (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Jul 8, 2021
1 parent 96b7b94 commit f07ae14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/non_exhaustive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": minor
---

Mark enums as `#[non_exhaustive]` to prevent breaking changes on enum update.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub mod webview;
pub type Result<T> = std::result::Result<T, Error>;

/// Errors returned by wry.
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum Error {
#[cfg(target_os = "linux")]
Expand Down
1 change: 1 addition & 0 deletions src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ impl RpcResponse {
}

/// An event enumeration sent to [`FileDropHandler`].
#[non_exhaustive]
#[derive(Debug, Serialize, Clone)]
pub enum FileDropEvent {
/// The file(s) have been dragged onto the window, but have not been dropped yet.
Expand Down

0 comments on commit f07ae14

Please sign in to comment.