(self, v: &str)
| 111 | } |
| 112 | |
| 113 | fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> |
| 114 | where |
| 115 | E: serde::de::Error, |
| 116 | { |
| 117 | let mut s = TryString::new(); |
| 118 | s.reserve_exact(v.len()).map_err(|oom| E::custom(oom))?; |
| 119 | s.push_str(v).expect("reserved capacity"); |
| 120 | Ok(s) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | // NB: do not use `deserialize_string` as that eagerly allocates the |