Skip to content

Commit 992e586

Browse files
authored
Merge pull request #441 from ink-feather-org/feat/improve_error_handling
Make error type 'static.
2 parents fbf0993 + d014ebf commit 992e586

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

plotters-backend/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<E: Error + Send + Sync> Error for DrawingErrorKind<E> {}
105105
/// will use the pixel-based approach to draw other types of low-level shapes.
106106
pub trait DrawingBackend: Sized {
107107
/// The error type reported by the backend
108-
type ErrorType: Error + Send + Sync;
108+
type ErrorType: Error + Send + Sync + 'static;
109109

110110
/// Get the dimension of the drawing backend in pixels
111111
fn get_size(&self) -> (u32, u32);

plotters/examples/console.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ impl DrawingBackend for TextDrawingBackend {
151151

152152
fn draw_chart<DB: DrawingBackend>(
153153
b: DrawingArea<DB, plotters::coord::Shift>,
154-
) -> Result<(), Box<dyn Error>>
155-
where
156-
DB::ErrorType: 'static,
157-
{
154+
) -> Result<(), Box<dyn Error>> {
158155
let mut chart = ChartBuilder::on(&b)
159156
.margin(1)
160157
.caption("Sine and Cosine", ("sans-serif", (10).percent_height()))

0 commit comments

Comments
 (0)