Skip to content

Instantly share code, notes, and snippets.

View aviau's full-sized avatar

Alexandre Viau aviau

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aviau on github.
  • I am aviau (https://keybase.io/aviau) on keybase.
  • I have a public key whose fingerprint is E301 54F5 429F FBB9 B22E 49C2 DA82 830E 3CCC 3A3A

To claim this, I am signing this object:

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

@aviau
aviau / zendesk_delete_orgs_and_users_with_no_tickets.py
Created July 30, 2024 14:10 — forked from fhoek/zendesk_delete_orgs_and_users_with_no_tickets.py
Zendesk cleanup. Iterates over organisations and retrieves the number of tickets, if zero it will delete the org and its users
#!/usr/bin/env python
#
# Copyright 2019 Trancon B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#