From 91e4b9fa1599d72a0c134189b498cfdbf2b0240a Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Wed, 12 Oct 2022 15:32:39 +0200 Subject: [PATCH] services/ime-plugin-api: Implement From instead of Into Signed-off-by: Jean-Pierre De Jesus DIAZ --- services/ime-plugin-api/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/ime-plugin-api/src/lib.rs b/services/ime-plugin-api/src/lib.rs index 9c63a1a43..557f1b908 100644 --- a/services/ime-plugin-api/src/lib.rs +++ b/services/ime-plugin-api/src/lib.rs @@ -34,16 +34,16 @@ pub struct PredictionTriggers { /// trigger word predictions on whitespace pub whitespace: bool, } -impl Into for PredictionTriggers { - fn into(self) -> usize { +impl From for usize { + fn from(pt: PredictionTriggers) -> usize { let mut ret: usize = 0; - if self.newline { + if pt.newline { ret |= 0x1; } - if self.punctuation { + if pt.punctuation { ret |= 0x2; } - if self.whitespace { + if pt.whitespace { ret |= 0x4; } ret