mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
services/ime-plugin-api: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
parent
136aec042b
commit
91e4b9fa15
1 changed files with 5 additions and 5 deletions
|
|
@ -34,16 +34,16 @@ pub struct PredictionTriggers {
|
||||||
/// trigger word predictions on whitespace
|
/// trigger word predictions on whitespace
|
||||||
pub whitespace: bool,
|
pub whitespace: bool,
|
||||||
}
|
}
|
||||||
impl Into<usize> for PredictionTriggers {
|
impl From<PredictionTriggers> for usize {
|
||||||
fn into(self) -> usize {
|
fn from(pt: PredictionTriggers) -> usize {
|
||||||
let mut ret: usize = 0;
|
let mut ret: usize = 0;
|
||||||
if self.newline {
|
if pt.newline {
|
||||||
ret |= 0x1;
|
ret |= 0x1;
|
||||||
}
|
}
|
||||||
if self.punctuation {
|
if pt.punctuation {
|
||||||
ret |= 0x2;
|
ret |= 0x2;
|
||||||
}
|
}
|
||||||
if self.whitespace {
|
if pt.whitespace {
|
||||||
ret |= 0x4;
|
ret |= 0x4;
|
||||||
}
|
}
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue