mirror of
https://github.com/sharkdp/bat
synced 2026-08-04 19:01:44 +00:00
Move transpose to util module
This commit is contained in:
+1
-6
@@ -20,6 +20,7 @@ use errors::*;
|
||||
use inputfile::InputFile;
|
||||
use line_range::LineRange;
|
||||
use style::{OutputComponent, OutputComponents, OutputWrap};
|
||||
use util::transpose;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum PagingMode {
|
||||
@@ -74,12 +75,6 @@ fn is_truecolor_terminal() -> bool {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Helper function that might appear in Rust stable at some point
|
||||
/// (https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.transpose)
|
||||
fn transpose<T>(opt: Option<Result<T>>) -> Result<Option<T>> {
|
||||
opt.map_or(Ok(None), |res| res.map(Some))
|
||||
}
|
||||
|
||||
pub struct App {
|
||||
pub matches: ArgMatches<'static>,
|
||||
interactive_output: bool,
|
||||
|
||||
Reference in New Issue
Block a user