File tree Expand file tree Collapse file tree 4 files changed +46
-5
lines changed Expand file tree Collapse file tree 4 files changed +46
-5
lines changed Original file line number Diff line number Diff line change 2037
2037
"contributions" : [
2038
2038
" content"
2039
2039
]
2040
+ },
2041
+ {
2042
+ "login" : " smlavine" ,
2043
+ "name" : " Sebastian LaVine" ,
2044
+ "avatar_url" : " https://avatars.githubusercontent.com/u/33563640?v=4" ,
2045
+ "profile" : " http://smlavine.com" ,
2046
+ "contributions" : [
2047
+ " code"
2048
+ ]
2049
+ },
2050
+ {
2051
+ "login" : " akgerber" ,
2052
+ "name" : " Alan Gerber" ,
2053
+ "avatar_url" : " https://avatars.githubusercontent.com/u/201313?v=4" ,
2054
+ "profile" : " http://www.alangerber.us" ,
2055
+ "contributions" : [
2056
+ " content"
2057
+ ]
2058
+ },
2059
+ {
2060
+ "login" : " esotuvaka" ,
2061
+ "name" : " Eric" ,
2062
+ "avatar_url" : " https://avatars.githubusercontent.com/u/104941850?v=4" ,
2063
+ "profile" : " http://esotuvaka.github.io" ,
2064
+ "contributions" : [
2065
+ " content"
2066
+ ]
2040
2067
}
2041
2068
],
2042
2069
"contributorsPerLine" : 8 ,
Original file line number Diff line number Diff line change @@ -288,6 +288,11 @@ authors.
288
288
<td align="center" valign="top" width="12.5%"><a href="https://ktheory.com/"><img src="https://avatars.githubusercontent.com/u/975?v=4?s=100" width="100px;" alt="Aaron Suggs"/><br /><sub><b>Aaron Suggs</b></sub></a><br /><a href="#content-ktheory" title="Content">🖋</a></td>
289
289
<td align="center" valign="top" width="12.5%"><a href="https://github.com/alexwh"><img src="https://avatars.githubusercontent.com/u/1723612?v=4?s=100" width="100px;" alt="Alex"/><br /><sub><b>Alex</b></sub></a><br /><a href="#content-alexwh" title="Content">🖋</a></td>
290
290
<td align="center" valign="top" width="12.5%"><a href="https://github.com/stornquist"><img src="https://avatars.githubusercontent.com/u/42915664?v=4?s=100" width="100px;" alt="Sebastian Törnquist"/><br /><sub><b>Sebastian Törnquist</b></sub></a><br /><a href="#content-stornquist" title="Content">🖋</a></td>
291
+ <td align="center" valign="top" width="12.5%"><a href="http://smlavine.com"><img src="https://avatars.githubusercontent.com/u/33563640?v=4?s=100" width="100px;" alt="Sebastian LaVine"/><br /><sub><b>Sebastian LaVine</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=smlavine" title="Code">💻</a></td>
292
+ </tr>
293
+ <tr>
294
+ <td align="center" valign="top" width="12.5%"><a href="http://www.alangerber.us"><img src="https://avatars.githubusercontent.com/u/201313?v=4?s=100" width="100px;" alt="Alan Gerber"/><br /><sub><b>Alan Gerber</b></sub></a><br /><a href="#content-akgerber" title="Content">🖋</a></td>
295
+ <td align="center" valign="top" width="12.5%"><a href="http://esotuvaka.github.io"><img src="https://avatars.githubusercontent.com/u/104941850?v=4?s=100" width="100px;" alt="Eric"/><br /><sub><b>Eric</b></sub></a><br /><a href="#content-esotuvaka" title="Content">🖋</a></td>
291
296
</tr>
292
297
</tbody >
293
298
</table >
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ mod tests {
52
52
fn owned_no_mutation ( ) -> Result < ( ) , & ' static str > {
53
53
// We can also pass `slice` without `&` so Cow owns it directly.
54
54
// In this case no mutation occurs and thus also no clone,
55
- // but the result is still owned because it always was.
55
+ // but the result is still owned because it was never borrowed
56
+ // or mutated.
56
57
let slice = vec ! [ 0 , 1 , 2 ] ;
57
58
let mut input = Cow :: from ( slice) ;
58
59
match abs_all ( & mut input) {
Original file line number Diff line number Diff line change @@ -298,13 +298,21 @@ fn spawn_watch_shell(
298
298
println ! ( "Bye!" ) ;
299
299
} else if input. eq ( "help" ) {
300
300
println ! ( "Commands available to you in watch mode:" ) ;
301
- println ! ( " hint - prints the current exercise's hint" ) ;
302
- println ! ( " clear - clears the screen" ) ;
303
- println ! ( " quit - quits watch mode" ) ;
304
- println ! ( " help - displays this help message" ) ;
301
+ println ! ( " hint - prints the current exercise's hint" ) ;
302
+ println ! ( " clear - clears the screen" ) ;
303
+ println ! ( " quit - quits watch mode" ) ;
304
+ println ! ( " !<cmd> - executes a command, like `!rustc --explain E0381`" ) ;
305
+ println ! ( " help - displays this help message" ) ;
305
306
println ! ( ) ;
306
307
println ! ( "Watch mode automatically re-evaluates the current exercise" ) ;
307
308
println ! ( "when you edit a file's contents." )
309
+ } else if let Some ( cmd) = input. strip_prefix ( '!' ) {
310
+ let parts: Vec < & str > = cmd. split_whitespace ( ) . collect ( ) ;
311
+ if parts. is_empty ( ) {
312
+ println ! ( "no command provided" ) ;
313
+ } else if let Err ( e) = Command :: new ( parts[ 0 ] ) . args ( & parts[ 1 ..] ) . status ( ) {
314
+ println ! ( "failed to execute command `{}`: {}" , cmd, e) ;
315
+ }
308
316
} else {
309
317
println ! ( "unknown command: {input}" ) ;
310
318
}
You can’t perform that action at this time.
0 commit comments