(buffer: &mut File, example: T)
| 173 | } |
| 174 | |
| 175 | fn write_example<T>(buffer: &mut File, example: T) -> Result<(), AppError> |
| 176 | where |
| 177 | T: serde::Serialize, |
| 178 | { |
| 179 | let example_toml = toml::to_string_pretty(&example)?; |
| 180 | writeln!(buffer, "\n# Example:")?; |
| 181 | for line in example_toml.split('\n') { |
| 182 | if line.trim() != "" { |
| 183 | writeln!(buffer, "# {}", line)?; |
| 184 | } |
| 185 | } |
| 186 | Ok(()) |
| 187 | } |
| 188 | |
| 189 | pub fn write_project(project: &Project) -> Result<(), AppError> { |
| 190 | let paths = fw_path()?; |
no outgoing calls
no test coverage detected