From 3046f9b87caf3d90a1c6802f4a3a921bf32d49d5 Mon Sep 17 00:00:00 2001 From: Sergey Duck Date: Thu, 21 May 2020 16:01:24 +0300 Subject: [PATCH] From trait for WindowPos --- src/sdl2/video.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sdl2/video.rs b/src/sdl2/video.rs index d393b226a8b..a389b62d2c6 100644 --- a/src/sdl2/video.rs +++ b/src/sdl2/video.rs @@ -483,6 +483,12 @@ pub enum WindowPos { Positioned(i32) } +impl From for WindowPos { + fn from(pos: i32) -> Self { + WindowPos::Positioned(pos) + } +} + fn to_ll_windowpos (pos: WindowPos) -> c_int { match pos { WindowPos::Undefined => sys::SDL_WINDOWPOS_UNDEFINED_MASK as c_int,