Bläddra i källkod

Merge pull request #147 from trevyn/fix_inherit

Fix spelling: "inhert" -> "inherit"
Jon Kelley 2 år sedan
förälder
incheckning
f1d18324ef
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 1 1
      docs/src/plugin/interface/command.md
  2. 5 5
      src/plugin/interface/command.rs

+ 1 - 1
docs/src/plugin/interface/command.md

@@ -4,7 +4,7 @@
 
 Type Define:
 ```
-Stdio: "Inhert" | "Piped" | "Null"
+Stdio: "Inherit" | "Piped" | "Null"
 ```
 
 ### `exec(commands: [string], stdout: Stdio, stderr: Stdio)`

+ 5 - 5
src/plugin/interface/command.rs

@@ -3,7 +3,7 @@ use std::process::{Command, Stdio};
 use mlua::{FromLua, UserData};
 
 enum StdioFromString {
-    Inhert,
+    Inherit,
     Piped,
     Null,
 }
@@ -12,19 +12,19 @@ impl<'lua> FromLua<'lua> for StdioFromString {
         if let mlua::Value::String(v) = lua_value {
             let v = v.to_str().unwrap();
             return Ok(match v.to_lowercase().as_str() {
-                "inhert" => Self::Inhert,
+                "inherit" => Self::Inherit,
                 "piped" => Self::Piped,
                 "null" => Self::Null,
-                _ => Self::Inhert,
+                _ => Self::Inherit,
             });
         }
-        Ok(Self::Inhert)
+        Ok(Self::Inherit)
     }
 }
 impl StdioFromString {
     pub fn to_stdio(self) -> Stdio {
         match self {
-            StdioFromString::Inhert => Stdio::inherit(),
+            StdioFromString::Inherit => Stdio::inherit(),
             StdioFromString::Piped => Stdio::piped(),
             StdioFromString::Null => Stdio::null(),
         }