This repository was archived by the owner on Jun 27, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -140,25 +140,23 @@ fn main() {{
140
140
return Ok ( String :: from ( "output too long, bailing out :(" ) ) ;
141
141
}
142
142
143
- // Print outputs up to 3 lines in length. Above that, print the first 2 lines followed by a
143
+ // Print outputs up to 2 lines in length. Above that, print the first line followed by a
144
144
// shortened playpen link.
145
145
let lines: Vec < & str > = out. lines ( ) . collect ( ) ;
146
- if lines. len ( ) <= 3 {
146
+ if lines. len ( ) <= 2 {
147
147
return Ok ( lines. join ( "\n " ) ) ;
148
148
}
149
149
150
- // Take the first 2 lines and append the URL
151
- let mut response = lines[ .. 3 ] . join ( " \n " ) ;
152
- match self . pastebin ( & code) {
153
- Ok ( short_url) => response . push_str ( & format ! ( "\n (output truncated; full output at {})" ,
154
- short_url) ) ,
150
+ // Take the first line and append the URL
151
+ let response = lines[ 0 ] ;
152
+ Ok ( match self . pastebin ( & code) {
153
+ Ok ( short_url) => format ! ( "{} \n (output truncated; full output at {})" ,
154
+ response , short_url) ,
155
155
Err ( e) => {
156
156
error ! ( "shortening url failed: {}" , e) ;
157
- response . push_str ( " \n (output truncated; shortening URL failed)") ;
157
+ format ! ( "{} \n (output truncated; shortening URL failed)", response )
158
158
}
159
- }
160
-
161
- Ok ( response)
159
+ } )
162
160
}
163
161
164
162
fn handle_cmd ( & mut self , response_to : & str , msg : & str ) {
You can’t perform that action at this time.
0 commit comments