Skip to content

Commit

Permalink
fix compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yliuuuu committed Jan 22, 2024
1 parent 3642df1 commit 79dbb0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_wasm_to_wesite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build and copy wasm
name: pr wasm to website

on:
push:
Expand Down
11 changes: 3 additions & 8 deletions src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
use std::fmt::{Error, format};
use std::io::ErrorKind;

use base64::{DecodeError, Engine};
use base64::Engine;
use base64::prelude::BASE64_URL_SAFE;
use ion_rs::{ion_struct, IonError, IonResult};
use ion_rs::ion_struct;
use ion_rs::element::Element;
use ion_rs::IonError::IoError;
use ion_rs::types::Struct;

pub(crate) fn encode_session(query: &str, env: &str) -> Result<String, String> {
let ion_struct: Element = ion_struct! {
Expand All @@ -25,7 +20,7 @@ pub(crate) fn decode_session(session: &str) -> Result<[String; 2], String> {
let error_prefix = "Error decoding session data: ";
let binary = match BASE64_URL_SAFE.decode(session) {
Ok(d) => { Ok(d) }
Err(e) => { Err(format!("{error_prefix}Not a valid base64 encoded string")) }
Err(_e) => { Err(format!("{error_prefix}Not a valid base64 encoded string")) }
}?;
let ion = Element::read_one(binary);
let ion_struct = if ion.is_ok() {
Expand Down

0 comments on commit 79dbb0a

Please sign in to comment.