Merge pull request #147 from trevyn/fix_inherit

Fix spelling: "inhert" -> "inherit"
This commit is contained in:
Jon Kelley authored and GitHub committed 2023-06-28 16:53:48 -07:00
commit f1d18324ef
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
Type Define: Type Define:
``` ```
Stdio: "Inhert" | "Piped" | "Null" Stdio: "Inherit" | "Piped" | "Null"
``` ```
### `exec(commands: [string], stdout: Stdio, stderr: Stdio)` ### `exec(commands: [string], stdout: Stdio, stderr: Stdio)`
+5 -5
View File
@@ -3,7 +3,7 @@ use std::process::{Command, Stdio};
use mlua::{FromLua, UserData}; use mlua::{FromLua, UserData};
enum StdioFromString { enum StdioFromString {
Inhert, Inherit,
Piped, Piped,
Null, Null,
} }
@@ -12,19 +12,19 @@ impl<'lua> FromLua<'lua> for StdioFromString {
if let mlua::Value::String(v) = lua_value { if let mlua::Value::String(v) = lua_value {
let v = v.to_str().unwrap(); let v = v.to_str().unwrap();
return Ok(match v.to_lowercase().as_str() { return Ok(match v.to_lowercase().as_str() {
"inhert" => Self::Inhert, "inherit" => Self::Inherit,
"piped" => Self::Piped, "piped" => Self::Piped,
"null" => Self::Null, "null" => Self::Null,
_ => Self::Inhert, _ => Self::Inherit,
}); });
} }
Ok(Self::Inhert) Ok(Self::Inherit)
} }
} }
impl StdioFromString { impl StdioFromString {
pub fn to_stdio(self) -> Stdio { pub fn to_stdio(self) -> Stdio {
match self { match self {
StdioFromString::Inhert => Stdio::inherit(), StdioFromString::Inherit => Stdio::inherit(),
StdioFromString::Piped => Stdio::piped(), StdioFromString::Piped => Stdio::piped(),
StdioFromString::Null => Stdio::null(), StdioFromString::Null => Stdio::null(),
} }