Skip to content

Commit

Permalink
chore: rename crate
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Sep 12, 2024
1 parent 55a7db5 commit 64f5b3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "match_deref"
version = "0.1.1"
name = "matchbox"
version = "0.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Deref patterns in \"match\" for stable Rust. Now you can match through Rc, String, etc"
homepage = "https://sr.ht/~safinaskar/match_deref-rs"
repository = "https://git.sr.ht/~safinaskar/match_deref-rs"
description = "`box` and deref patterns in \"match\" for stable Rust. Now you can match through `Box`, `Rc`, etc."
repository = "https://github.com/hydro-project/matchbox"

[lib]
proc-macro = true
Expand Down
18 changes: 9 additions & 9 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn tests() {
Symbol(String),
}
use LispValue::*;
let _: i32 = match_deref::match_deref!{
let _: i32 = matchbox::match_deref!{
match &Nil {
Nil => 0,
Cons(Deref @ _, Deref @ Nil) => 0,
Expand All @@ -19,26 +19,26 @@ fn tests() {
Symbol(_) => 0,
}
};
assert_eq!(match_deref::match_deref!{
assert_eq!(matchbox::match_deref!{
match &Cons(Rc::new(Symbol("a".to_owned())), Rc::new(Nil)) {
Cons(Deref @ Symbol(Deref @ "a"), _) => 1,
_ => 0
}
}, 1);
assert_eq!(match_deref::match_deref!{
assert_eq!(matchbox::match_deref!{
match &Cons(Rc::new(Symbol("a".to_owned())), Rc::new(Nil)) {
Cons(Deref @ Symbol(Deref @ "b"), _) => 1,
_ => 0
}
}, 0);
assert_eq!(match_deref::match_deref!{
assert_eq!(matchbox::match_deref!{
match &Cons(Rc::new(Symbol("a".to_owned())), Rc::new(Nil)) {
Cons(Deref @ Symbol(Deref @ "a"), Deref @ x) => x,
_ => panic!()
}
}, &Nil);
assert_eq!((||{
let _: i32 = match_deref::match_deref!{
let _: i32 = matchbox::match_deref!{
match &Cons(Rc::new(Symbol("a".to_owned())), Rc::new(Nil)) {
Cons(Deref @ Symbol(Deref @ "a"), Deref @ x) => return x.clone(),
_ => 0
Expand All @@ -48,14 +48,14 @@ fn tests() {
})(), Nil);
{
let a0 = 0;
assert_eq!(match_deref::match_deref!{
assert_eq!(matchbox::match_deref!{
match &Rc::new(Nil) {
Deref @ _ => a0,
_ => panic!()
}
}, 0);
}
match_deref::match_deref!{
matchbox::match_deref!{
match &Cons(Rc::new(Nil), Rc::new(Nil)) {
Cons(a @ Deref @ b @ Nil, _) => {
assert_eq!(a, &Rc::new(Nil));
Expand All @@ -64,9 +64,9 @@ fn tests() {
_ => panic!(),
}
}
assert_eq!(match_deref::match_deref!{
assert_eq!(matchbox::match_deref!{
match &Cons(Rc::new(Cons(Rc::new(Nil), Rc::new(Nil))), Rc::new(Nil)) {
Cons(Deref @ a, _) => match_deref::match_deref! {
Cons(Deref @ a, _) => matchbox::match_deref! {
match a {
Cons(Deref @ Nil, _) => 5,
_ => panic!(),
Expand Down

0 comments on commit 64f5b3e

Please sign in to comment.