mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 05:43:53 +01:00
remove O: Write constraint on pretty_print_to
This commit is contained in:
parent
14c8e7717d
commit
d01da83866
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mers_lib"
|
||||
version = "0.8.23"
|
||||
version = "0.8.24"
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "library to use the mers language in other projects"
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{io::Write, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
errors::CheckError,
|
||||
@ -12,10 +12,11 @@ pub fn pretty_print(src: Source) {
|
||||
eprintln!("{e:?}");
|
||||
std::process::exit(28);
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
/// to print to stdout, use `pretty_print` (available only with the `ecolor-term` feature)
|
||||
pub fn pretty_print_to<O: Write>(
|
||||
pub fn pretty_print_to<O>(
|
||||
mut src: Source,
|
||||
out: &mut O,
|
||||
theme: impl FTheme<O>,
|
||||
@ -140,7 +141,7 @@ impl ThemeGen for HtmlDefaultTheme {
|
||||
pub trait FTheme<O>: ThemeGen<C = FColor, T = O> {}
|
||||
impl<O, T: ThemeGen<C = FColor, T = O>> FTheme<O> for T {}
|
||||
|
||||
fn print_parsed<O: Write>(
|
||||
fn print_parsed<O>(
|
||||
srca: &Arc<Source>,
|
||||
parsed: &dyn crate::program::parsed::MersStatement,
|
||||
out: &mut O,
|
||||
@ -158,7 +159,6 @@ fn print_parsed<O: Write>(
|
||||
theme.color(&src[i..end], clr, out);
|
||||
i = end;
|
||||
}
|
||||
let _ = writeln!(out);
|
||||
}
|
||||
fn build_print(
|
||||
sections: &mut Vec<(FColor, usize)>,
|
||||
|
Loading…
Reference in New Issue
Block a user