mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 20:34:06 +00:00
parent
466caa77bb
commit
e9f5382757
10
tests/lib.rs
10
tests/lib.rs
@ -330,26 +330,28 @@ fn check_files(files: Vec<PathBuf>) -> (Vec<FormatReport>, u32, u32) {
|
||||
}
|
||||
|
||||
fn print_mismatches_default_message(result: HashMap<PathBuf, Vec<Mismatch>>) {
|
||||
let mut t = term::stdout().unwrap();
|
||||
for (file_name, diff) in result {
|
||||
let mismatch_msg_formatter =
|
||||
|line_num| format!("\nMismatch at {}:{}:", file_name.display(), line_num);
|
||||
print_diff(diff, &mismatch_msg_formatter, Color::Auto);
|
||||
}
|
||||
|
||||
t.reset().unwrap();
|
||||
if let Some(mut t) = term::stdout() {
|
||||
t.reset().unwrap_or(());
|
||||
}
|
||||
}
|
||||
|
||||
fn print_mismatches<T: Fn(u32) -> String>(
|
||||
result: HashMap<PathBuf, Vec<Mismatch>>,
|
||||
mismatch_msg_formatter: T,
|
||||
) {
|
||||
let mut t = term::stdout().unwrap();
|
||||
for (_file_name, diff) in result {
|
||||
print_diff(diff, &mismatch_msg_formatter, Color::Auto);
|
||||
}
|
||||
|
||||
t.reset().unwrap();
|
||||
if let Some(mut t) = term::stdout() {
|
||||
t.reset().unwrap_or(());
|
||||
}
|
||||
}
|
||||
|
||||
fn read_config(filename: &Path) -> Config {
|
||||
|
@ -23,3 +23,18 @@ fn impl_trait_fn_2<E>() -> impl Future<Item=&'a i64,Error=E> {}
|
||||
fn issue_1234() {
|
||||
do_parse!(name: take_while1!(is_token) >> (Header))
|
||||
}
|
||||
|
||||
// #2510
|
||||
impl CombineTypes {
|
||||
pub fn pop_callback(
|
||||
&self,
|
||||
query_id: Uuid,
|
||||
) -> Option<
|
||||
(
|
||||
ProjectId,
|
||||
Box<FnMut(&ProjectState, serde_json::Value, bool) -> () + Sync + Send>,
|
||||
),
|
||||
> {
|
||||
self.query_callbacks()(&query_id)
|
||||
}
|
||||
}
|
||||
|
@ -29,3 +29,16 @@ fn impl_trait_fn_2<E>() -> impl Future<Item = &'a i64, Error = E> {}
|
||||
fn issue_1234() {
|
||||
do_parse!(name: take_while1!(is_token) >> (Header))
|
||||
}
|
||||
|
||||
// #2510
|
||||
impl CombineTypes {
|
||||
pub fn pop_callback(
|
||||
&self,
|
||||
query_id: Uuid,
|
||||
) -> Option<(
|
||||
ProjectId,
|
||||
Box<FnMut(&ProjectState, serde_json::Value, bool) -> () + Sync + Send>,
|
||||
)> {
|
||||
self.query_callbacks()(&query_id)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user