Update an existing [`Table`] with the values of a [`ServerConfig`].
(edit: &mut toml_edit::Table, from: &ServerConfig)
| 37 | |
| 38 | /// Update an existing [`Table`] with the values of a [`ServerConfig`]. |
| 39 | pub fn update_table(edit: &mut toml_edit::Table, from: &ServerConfig) { |
| 40 | set_table_opt_value(edit, NICKNAME_KEY, from.nickname.as_deref()); |
| 41 | set_table_opt_value(edit, HOST_KEY, Some(&from.host)); |
| 42 | set_table_opt_value(edit, PROTOCOL_KEY, Some(&from.protocol)); |
| 43 | set_table_opt_value(edit, ECDSA_PUBLIC_KEY, from.ecdsa_public_key.as_deref()); |
| 44 | } |
| 45 | |
| 46 | fn nick_or_host(&self) -> &str { |
| 47 | if let Some(nick) = &self.nickname { |
nothing calls this directly
no test coverage detected