add instruction to declare utils module in main.rs

This commit is contained in:
glyph 2022-10-02 17:08:50 +01:00
parent 5c0d4726c0
commit 66a5f8b58d
1 changed files with 6 additions and 0 deletions

View File

@ -244,6 +244,12 @@ pub fn validate_public_key(public_key: &str) -> Result<(), String> {
}
```
The `utils` module needs to registered in `main.rs`. Without this addition, the module will not be compiled and the `validate_public_key` function will not be available to the rest of our program. Add this line at the top of `src/main.rs`:
```rust
mod utils;
```
Now the validation function can be called from our subscribe / unsubscribe route handlers, allowing us to ensure the provided public key is valid before using it to make further RPC calls to the sbot:
`src/routes.rs`