(&self, meth: &str)
| 55 | } |
| 56 | impl CanisterInfo { |
| 57 | pub fn match_method(&self, meth: &str) -> Vec<Pair> { |
| 58 | self.methods |
| 59 | .iter() |
| 60 | .filter(|(name, _)| name.starts_with(meth)) |
| 61 | .map(|(meth, func)| { |
| 62 | let mut replacement = format!(".{meth}("); |
| 63 | if func.args.is_empty() { |
| 64 | replacement.push(')'); |
| 65 | } |
| 66 | Pair { |
| 67 | display: format!("{meth} : {func}"), |
| 68 | replacement, |
| 69 | } |
| 70 | }) |
| 71 | .collect() |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | #[derive(Helper)] |