gdritter repos mattermost-rs / master
Switch to using a custom error type Getty Ritter 5 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Collapse all Expand all
120120 }
121121 }
122122
123 fn main() {
123 fn main() -> mm::Result<()> {
124124 let password = temp_password().unwrap();
125125 let login = Login {
126126 login_id: "gdritter".to_string(),
127127 password,
128128 };
129 let s = Session::login(&login, "https://mm.infinitenegativeutility.com").unwrap();
130 for t in s.get_teams().unwrap() {
131 let chans = s.get_channels_for_user(&s.get_me().id, &t.id).unwrap();
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)?;
132132 println!("Got chans: {:#?}", chans);
133133 }
134 Ok(())
134135 }