Created
September 8, 2017 14:59
-
-
Save daschl/c3eabd0bc79c06259f1d9fea6b4d8f1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn from_config<S>(config: &BackendConfig) -> Result<impl Backend<S>, BackendError> where S: IntoBuf + 'static { | |
match config.name() { | |
"stdout" => Ok(StdoutBackend::stdout()), | |
"stderr" => Ok(StderrBackend::stderr()), | |
n => Err(BackendError::UnsupportedBackend(n.into())), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error[E0308]: mismatched types
--> src/backend/mod.rs:24:24
|
24 | "stderr" => Ok(StderrBackend::stderr()),
| ^^^^^^^^^^^^^^^^^^^^^^^ expected struct
std::io::Stdout
, found structstd::io::Stderr
|
= note: expected type
backend::console::ConsoleBackend<S, std::io::Stdout>
found type
backend::console::ConsoleBackend<_, std::io::Stderr>