Switch to using a custom error type
Getty Ritter
6 years ago
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 |
fn main() |
|
| 123 | fn main() -> mm::Result<()> { | |
| 124 | 124 | let password = temp_password().unwrap(); |
| 125 | 125 | let login = Login { |
| 126 | 126 | login_id: "gdritter".to_string(), |
| 127 | 127 | password, |
| 128 | 128 | }; |
| 129 | let s = Session::login(&login, "https://mm.infinitenegativeutility.com").unwrap(); | |
| 130 | for t in s.get_teams().unwrap() { | |
| 131 |
|
|
| 129 | let s = Session::login(&login, "https://mm.infinitenegativeutility.com")?; | |
| 130 | for t in s.get_teams()? { | |
| 131 | let chans = s.get_channels_for_user(&s.get_me().id, &t.id)?; | |
| 132 | 132 | println!("Got chans: {:#?}", chans); |
| 133 | 133 | } |
| 134 | Ok(()) | |
| 134 | 135 | } |