You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sponsors.rs
    path of file: ./repos/fornjot/tools/automator/src
    
    the code of the file until where you have to start completion: use std::{cmp::Ordering, collections::HashMap, fmt::Write};

use anyhow::Context;
use chrono::{DateTime, Utc};
use octocrab::Octocrab;
use tracing::debug;

#[derive(Debug)]
pub struct Sponsors {
    pub inner: Vec<Sponsor>,
}

impl Sponsors {
    pub async fn query(octocrab: &Octocrab) -> anyhow::Result<Self> {
        let graphql_query = "\
            query {
                viewer {
                    sponsors(first: 100) {
                        nodes {
                            __typename
                            ... on User {
                                login
                                sponsorshipForViewerAsSponsorable {
                                    privacyLevel
                                    createdAt
                                    tier {
                                        monthlyPriceInDollars
                                    }
                                    isOneTimePayment
                                }
                            }
                            ... on Organization {
                                login
                                sponsorshipForViewerAsSponsorable {
                                    privacyLevel
                                    createdAt
                                    tier {
                                        monthlyPriceInDollars
                                    }
                                    isOneTimePayment
                                }
                            }
                        }
                    }
                }
            }";

        let mut json_object = HashMap::new();
        json_object.insert("query", graphql_query);

        let response: serde_json::Value = octocrab
            .graphql(&json_object)
            .await
            .context("GraphQL query failed")?;

        debug!("Response to GraphQL query for sponsors:\n{response}");

        let response: QueryResult = serde_json::from_value(response)
            .context("Failed to deserialize GraphQL query result")?;

        let mut sponsors = response
            .data
            .viewer
            .sponsors
            .nodes
            .into_iter()
            .filter_map(|node| {
                if let QueryResultSponsorshipPrivacy::Private =
                    node.sponsorship_for_viewer_as_sponsorable.privacy_level
                {
                    return None;
                }

                if node
                    .sponsorship_for_viewer_as_sponsorable
                    .is_one_time_payment
                {
                    return None;
                }

                let login = node.login;
                let since =
                    node.sponsorship_for_viewer_as_sponsorable.created_at;
                let dollars = node
                    .sponsorship_for_viewer_as_sponsorable
                    .tier
                    .mo
    
    pub async fn query(octocrab: &Octocrab) -> anyhow::Result<Self> {
        let graphql_query = "\
            query {
                viewer {
                    sponsors(first: 100) {
                        nodes {
                            __typename
                            ... on User {
                                login
                                sponsorshipForViewerAsSponsorable {
                                    privacyLevel
                                    createdAt
                                    tier {
                                        monthlyPriceInDollars
                                    }
                                    isOneTimePayment
                                }
                            }
                            ... on Organization {
                                login
                                sponsorshipForViewerAsSponsorable {
                                    privacyLevel
                                    createdAt
                                    tier {
                                        monthlyPriceInDollars
                                    }
                                    isOneTimePayment
                                }
                            }
                        }
                    }
                }
            }";

        let mut json_object = HashMap::new();
        json_object.insert("query", graphql_query);

        let response: serde_json::Value = octocrab
            .graphql(&json_object)
            .await
            .context("GraphQL query failed")?;

        debug!("Response to GraphQL query for sponsors:\n{response}");

        let response: QueryResult = serde_json::from_value(response)
            .context("Failed to deserialize GraphQL query result")?;

        let mut sponsors = response
            .data
            .viewer
            .sponsors
            .nodes
            .into_iter()
            .filter_map(|node| {
                if let QueryResultSponsorshipPrivacy::Private =
                    node.sponsorship_for_viewer_as_sponsorable.privacy_level
                {
                    return None;
                }

                if node
                    .sponsorship_for_viewer_as_sponsorable
                    .is_one_time_payment
                {
                    return None;
                }

                let login = node.login;
                let since =
                    node.sponsorship_for_viewer_as_sponsorable.created_at;
                let dollars = node
                    .sponsorship_for_viewer_as_sponsorable
                    .tier
                    .monthly_price_in_dollars;

                Some(Sponsor {
                    login,
                    since,
                    dollars,
                })
            })
            .collect::<Vec<_>>();

        if sponsors.len() >= 100 {
            todo!(
                "Number of sponsors has reached max page size, but query does \
                not support pagination."
            )
        }

        sponsors.sort();

        Ok(Self { inner: sponsors })
    }