gd 0.0.0

Geometry Dash API wrapper written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::string::FromUtf8Error;

use miette::Diagnostic;
use thiserror::Error;

#[derive(Debug, Error, Diagnostic)]
#[error("invalid utf-8 was found")]
#[diagnostic(
    code(gd::crypto::base64::utf8),
    help("make sure the output is valid utf-8")
)]
pub struct Error(#[from] pub FromUtf8Error);

pub fn convert(vec: Vec<u8>) -> Result<String, Error> {
    String::from_utf8(vec).map_err(Error)
}