]> Repositorios git - scryer-prolog.git/commitdiff
Derive Default for StreamConfig
authorbakaq <[email protected]>
Thu, 12 Dec 2024 08:38:55 +0000 (05:38 -0300)
committerbakaq <[email protected]>
Thu, 12 Dec 2024 08:47:01 +0000 (05:47 -0300)
src/machine/config.rs

index 039cf2f454b4520ae3d83f9465e5de00ea5134fd..4e1e053201e9cb4cb7108a6cac22a85869e879bd 100644 (file)
@@ -8,17 +8,11 @@ use super::{
 };
 
 /// Describes how the streams of a [`Machine`](crate::Machine) will be handled.
+#[derive(Default)]
 pub struct StreamConfig {
     inner: StreamConfigInner,
 }
 
-impl Default for StreamConfig {
-    /// Defaults to using in-memory streams.
-    fn default() -> Self {
-        Self::in_memory()
-    }
-}
-
 impl StreamConfig {
     /// Binds the input, output and error streams to stdin, stdout and stderr.
     pub fn stdio() -> Self {
@@ -37,8 +31,10 @@ impl StreamConfig {
     }
 }
 
+#[derive(Default)]
 enum StreamConfigInner {
     Stdio,
+    #[default]
     Memory,
 }