aoc-session

Crates.ioaoc-session
lib.rsaoc-session
version0.2.1
sourcesrc
created_at2023-11-30 08:26:56.006464
updated_at2023-11-30 12:14:08.019599
descriptionGet the session cookie value for Advent of Code easily
homepage
repositoryhttps://github.com/JohnScience/aoc-session
max_upload_size
id1053982
size56,637
Dmitrii - Demenev (JohnScience)

documentation

https://docs.rs/aoc-session

README

Get the session cookie value for Advent of Code easily

Crates.io Downloads Documentation License Dependency Status

Usage (library)

use aoc_session::aoc_session;

fn main() {
    let session_id: String = match aoc_session() {
        // Ok(session) => <aoc_session::AocSession as ToString>::to_string(&session),
        Ok(session) => session.to_string(),
        Err(e) => panic!("Error: {e}"),
    };

    assert!(session_id.len() > 0);
    println!("My session ID: {}", session_id);
}

Installation (executable)

cargo install aoc-session

Usage (executable)

aoc-session

Learn more

This crate was born while preparing the presentation for Calgary Rust community. It better explains what this crate provides and how it works.

Commit count: 4

cargo fmt