MCPcopy Create free account
hub / github.com/brocode/fw / write_example

Function write_example

src/config/mod.rs:175–187  ·  view source on GitHub ↗
(buffer: &mut File, example: T)

Source from the content-addressed store, hash-verified

173}
174
175fn write_example<T>(buffer: &mut File, example: T) -> Result<(), AppError>
176where
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
189pub fn write_project(project: &Project) -> Result<(), AppError> {
190 let paths = fw_path()?;

Callers 3

write_settingsFunction · 0.85
write_tagFunction · 0.85
write_projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected