Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ impl<'input> Tokenizer<'input> {

pub type Span = std::ops::Range<usize>;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Spanned<T> {
pub span: Span,
pub value: T,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct LexicalError {
pub err: String,
pub span: Span,
Expand Down
5 changes: 3 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use candid_parser::configs::Configs;
use ic_agent::Agent;
use std::borrow::Cow;
use std::path::{Path, PathBuf};
use std::slice;

pub fn stringify(v: &IDLValue) -> anyhow::Result<Cow<str>> {
pub fn stringify(v: &IDLValue) -> anyhow::Result<Cow<'_, str>> {
Ok(match v {
IDLValue::Text(str) => Cow::Borrowed(str),
IDLValue::Number(_)
Expand Down Expand Up @@ -240,7 +241,7 @@ pub fn random_value(
use rand::Rng;
let mut rng = rand::thread_rng();
let seed: Vec<_> = (0..2048).map(|_| rng.gen::<u8>()).collect();
let result = candid_parser::random::any(&seed, config, env, &[ty.clone()], &Some(scope))?;
let result = candid_parser::random::any(&seed, config, env, slice::from_ref(ty), &Some(scope))?;
Ok(result.args[0].to_string())
}

Expand Down
Loading