mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Make send_set_from helper
This commit is contained in:
parent
4e6fcd0eb0
commit
fde17405f5
1 changed files with 16 additions and 1 deletions
|
@ -6,7 +6,7 @@ use roc::can::expr::Expr;
|
||||||
use roc::can::problem::Problem;
|
use roc::can::problem::Problem;
|
||||||
use roc::can::symbol::Symbol;
|
use roc::can::symbol::Symbol;
|
||||||
use roc::can::Output;
|
use roc::can::Output;
|
||||||
use roc::collections::{ImMap, MutMap};
|
use roc::collections::{ImMap, MutMap, SendSet};
|
||||||
use roc::ident::Ident;
|
use roc::ident::Ident;
|
||||||
use roc::parse;
|
use roc::parse;
|
||||||
use roc::parse::ast::{self, Attempting};
|
use roc::parse::ast::{self, Attempting};
|
||||||
|
@ -110,6 +110,21 @@ where
|
||||||
answer
|
answer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn send_set_from<V, I>(elems: I) -> SendSet<V>
|
||||||
|
where
|
||||||
|
I: IntoIterator<Item = V>,
|
||||||
|
V: Hash + Eq + Clone,
|
||||||
|
{
|
||||||
|
let mut answer = SendSet::default();
|
||||||
|
|
||||||
|
for elem in elems {
|
||||||
|
answer.insert(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
answer
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn fixtures_dir<'a>() -> PathBuf {
|
pub fn fixtures_dir<'a>() -> PathBuf {
|
||||||
Path::new("tests").join("fixtures").join("build")
|
Path::new("tests").join("fixtures").join("build")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue