@@ -56,6 +56,8 @@ Regarding the loop templates: what I *want* is for the result of the closure to
56
56
57
57
/// The template used for `--loop` input, assuming no `--count` flag is also given.
58
58
pub const LOOP_TEMPLATE : & str = r#"
59
+ #![allow(unused_imports)]
60
+ #![allow(unused_braces)]
59
61
#{prelude}
60
62
use std::any::Any;
61
63
use std::io::prelude::*;
@@ -65,15 +67,15 @@ fn main() {
65
67
{#{script}}
66
68
);
67
69
let mut line_buffer = String::new();
68
- let mut stdin = std::io::stdin();
70
+ let stdin = std::io::stdin();
69
71
loop {
70
72
line_buffer.clear();
71
73
let read_res = stdin.read_line(&mut line_buffer).unwrap_or(0);
72
74
if read_res == 0 { break }
73
75
let output = closure(&line_buffer);
74
76
75
77
let display = {
76
- let output_any: &Any = &output;
78
+ let output_any: &dyn Any = &output;
77
79
!output_any.is::<()>()
78
80
};
79
81
@@ -91,6 +93,8 @@ where F: FnMut(&str) -> T, T: 'static {
91
93
92
94
/// The template used for `--count --loop` input.
93
95
pub const LOOP_COUNT_TEMPLATE : & str = r#"
96
+ #![allow(unused_imports)]
97
+ #![allow(unused_braces)]
94
98
use std::any::Any;
95
99
use std::io::prelude::*;
96
100
@@ -99,7 +103,7 @@ fn main() {
99
103
{#{script}}
100
104
);
101
105
let mut line_buffer = String::new();
102
- let mut stdin = std::io::stdin();
106
+ let stdin = std::io::stdin();
103
107
let mut count = 0;
104
108
loop {
105
109
line_buffer.clear();
@@ -109,7 +113,7 @@ fn main() {
109
113
let output = closure(&line_buffer, count);
110
114
111
115
let display = {
112
- let output_any: &Any = &output;
116
+ let output_any: &dyn Any = &output;
113
117
!output_any.is::<()>()
114
118
};
115
119
0 commit comments