-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-FileCopyrightText: © 2023 Caleb Maclennan <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
use mlua::prelude::*; | ||
Check failure on line 4 in src/content.rs GitHub Actions / clippyfailed to resolve: use of undeclared crate or module `mlua`
|
||
use mlua::FromLua; | ||
Check failure on line 5 in src/content.rs GitHub Actions / clippyunresolved import `mlua`
|
||
|
||
use crate::types::Result; | ||
use regex::Regex; | ||
use std::{borrow::Cow, fmt, fmt::Display, str::FromStr}; | ||
|
@@ -12,7 +15,7 @@ pub enum Segment { | |
Word(String), | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
#[derive(Clone, Debug)] | ||
#[non_exhaustive] | ||
pub struct Chunk { | ||
pub segments: Vec<Segment>, | ||
|
@@ -80,3 +83,18 @@ impl Display for Chunk { | |
Ok(()) | ||
} | ||
} | ||
|
||
impl FromLua for Chunk { | ||
fn from_lua(_value: LuaValue, _: &Lua) -> LuaResult<Self> { | ||
Check failure on line 88 in src/content.rs GitHub Actions / clippycannot find type `LuaResult` in this scope
Check failure on line 88 in src/content.rs GitHub Actions / clippycannot find type `Lua` in this scope
Check failure on line 88 in src/content.rs GitHub Actions / clippycannot find type `LuaValue` in this scope
Check failure on line 88 in src/content.rs GitHub Actions / test
Check failure on line 88 in src/content.rs GitHub Actions / test
|
||
Ok(split_chunk("foo bar")) | ||
//match value { | ||
// LuaValue::String(s) => { | ||
// let f = s.to_string_lossy(); | ||
// dbg!(f); | ||
// Ok(split_chunk("foo bar")) | ||
// //Ok(s.to_string_lossy().into()) | ||
// } | ||
// _ => todo!(), | ||
//} | ||
} | ||
} |