(&self)
| 396 | |
| 397 | impl IntentUpdate { |
| 398 | fn resolve_body(&self) -> CliResult<Option<String>> { |
| 399 | if let Some(ref body) = self.body { |
| 400 | return Ok(Some(body.clone())); |
| 401 | } |
| 402 | if self.body_stdin { |
| 403 | use std::io::Read; |
| 404 | let mut content = String::new(); |
| 405 | std::io::stdin() |
| 406 | .read_to_string(&mut content) |
| 407 | .map_err(CliError::Io)?; |
| 408 | return Ok(Some(content)); |
| 409 | } |
| 410 | Ok(None) |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | impl Command for IntentUpdate { |