File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ fn run_bin(
31
31
) -> Result < bool > {
32
32
if let Some ( output) = output. as_deref_mut ( ) {
33
33
write_ansi ( output, SetAttribute ( Attribute :: Underlined ) ) ;
34
- output. extend_from_slice ( b"Output\n " ) ;
34
+ output. extend_from_slice ( b"Output" ) ;
35
35
write_ansi ( output, ResetColor ) ;
36
+ output. push ( b'\n' ) ;
36
37
}
37
38
38
39
let success = cmd_runner. run_debug_bin ( bin_name, output. as_deref_mut ( ) ) ?;
@@ -44,8 +45,9 @@ fn run_bin(
44
45
// leaves the user confused about why the exercise isn't done yet.
45
46
write_ansi ( output, SetAttribute ( Attribute :: Bold ) ) ;
46
47
write_ansi ( output, SetForegroundColor ( Color :: Red ) ) ;
47
- output. extend_from_slice ( b"The exercise didn't run successfully (nonzero exit code)\n " ) ;
48
+ output. extend_from_slice ( b"The exercise didn't run successfully (nonzero exit code)" ) ;
48
49
write_ansi ( output, ResetColor ) ;
50
+ output. push ( b'\n' ) ;
49
51
}
50
52
}
51
53
Original file line number Diff line number Diff line change @@ -148,10 +148,11 @@ pub fn init() -> Result<()> {
148
148
}
149
149
150
150
stdout. queue ( SetForegroundColor ( Color :: Green ) ) ?;
151
- stdout. write_all ( "Initialization done ✓\n \n " . as_bytes ( ) ) ?;
152
- stdout
153
- . queue ( ResetColor ) ?
154
- . queue ( SetAttribute ( Attribute :: Bold ) ) ?;
151
+ stdout. write_all ( "Initialization done ✓" . as_bytes ( ) ) ?;
152
+ stdout. queue ( ResetColor ) ?;
153
+ stdout. write_all ( b"\n \n " ) ?;
154
+
155
+ stdout. queue ( SetAttribute ( Attribute :: Bold ) ) ?;
155
156
stdout. write_all ( POST_INIT_MSG ) ?;
156
157
stdout. queue ( ResetColor ) ?;
157
158
Original file line number Diff line number Diff line change @@ -149,8 +149,9 @@ impl<'a> WatchState<'a> {
149
149
Attributes :: from ( Attribute :: Bold ) . with ( Attribute :: Underlined ) ,
150
150
) ) ?
151
151
. queue ( SetForegroundColor ( Color :: Cyan ) ) ?;
152
- stdout. write_all ( b"Hint\n " ) ?;
152
+ stdout. write_all ( b"Hint" ) ?;
153
153
stdout. queue ( ResetColor ) ?;
154
+ stdout. write_all ( b"\n " ) ?;
154
155
155
156
stdout. write_all ( self . app_state . current_exercise ( ) . hint . as_bytes ( ) ) ?;
156
157
stdout. write_all ( b"\n \n " ) ?;
@@ -160,16 +161,17 @@ impl<'a> WatchState<'a> {
160
161
stdout
161
162
. queue ( SetAttribute ( Attribute :: Bold ) ) ?
162
163
. queue ( SetForegroundColor ( Color :: Green ) ) ?;
163
- stdout. write_all ( "Exercise done ✓\n " . as_bytes ( ) ) ?;
164
+ stdout. write_all ( "Exercise done ✓" . as_bytes ( ) ) ?;
164
165
stdout. queue ( ResetColor ) ?;
166
+ stdout. write_all ( b"\n " ) ?;
165
167
166
168
if let DoneStatus :: DoneWithSolution ( solution_path) = & self . done_status {
167
169
solution_link_line ( stdout, solution_path) ?;
168
170
}
169
171
170
- writeln ! (
171
- stdout ,
172
- "When done experimenting, enter `n` to move on to the next exercise 🦀 \n " ,
172
+ stdout . write_all (
173
+ "When done experimenting, enter `n` to move on to the next exercise 🦀 \n \n "
174
+ . as_bytes ( ) ,
173
175
) ?;
174
176
}
175
177
You can’t perform that action at this time.
0 commit comments