MCPcopy Create free account
hub / github.com/PowerShell/DSC / write_to_config

Method write_to_config

resources/sshdconfig/src/formatter.rs:65–79  ·  view source on GitHub ↗
(&self, config_text: &mut String)

Source from the content-addressed store, hash-verified

63 }
64
65 pub fn write_to_config(&self, config_text: &mut String) -> Result<(), SshdConfigError> {
66 if self.keyword_info.is_repeatable {
67 if let Value::Array(arr) = self.value {
68 for item in arr {
69 let item = SshdConfigValue::try_new(self.key, item, Some(self.keyword_info.separator), self.use_quotes)?;
70 writeln!(config_text, "{} {item}", self.key)?;
71 }
72 } else {
73 writeln!(config_text, "{} {self}", self.key)?;
74 }
75 } else {
76 writeln!(config_text, "{} {self}", self.key)?;
77 }
78 Ok(())
79 }
80}
81
82impl fmt::Display for SshdConfigValue<'_> {

Callers 1

write_config_map_to_textFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected