-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from georust/kyle/geo-traits-writer
Implement geo-traits for writing to WKT & perf improvement
- Loading branch information
Showing
13 changed files
with
558 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::fmt; | ||
|
||
use thiserror::Error; | ||
|
||
/// Generic errors for WKT writing and reading | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
#[error("Only 2D input is supported when writing Rect to WKT.")] | ||
RectUnsupportedDimension, | ||
#[error("Only defined dimensions and undefined dimensions of 2, 3, or 4 are supported.")] | ||
UnknownDimension, | ||
/// Wrapper around `[std::fmt::Error]` | ||
#[error(transparent)] | ||
FmtError(#[from] std::fmt::Error), | ||
} | ||
|
||
impl From<Error> for fmt::Error { | ||
fn from(value: Error) -> Self { | ||
match value { | ||
Error::FmtError(err) => err, | ||
_ => std::fmt::Error, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.