(&self)
| 64 | |
| 65 | impl IntentUpdate { |
| 66 | fn resolve_body(&self) -> CliResult<Option<String>> { |
| 67 | if let Some(ref body) = self.body { |
| 68 | return Ok(Some(body.clone())); |
| 69 | } |
| 70 | if self.body_stdin { |
| 71 | use std::io::Read; |
| 72 | let mut content = String::new(); |
| 73 | std::io::stdin() |
| 74 | .read_to_string(&mut content) |
| 75 | .map_err(CliError::Io)?; |
| 76 | return Ok(Some(content)); |
| 77 | } |
| 78 | Ok(None) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | impl Command for IntentUpdate { |