Skip to content

Commit 953e2ed

Browse files
committed
Update cgp and use direct consumer delegation
1 parent bc8b5fe commit 953e2ed

File tree

5 files changed

+27
-50
lines changed

5 files changed

+27
-50
lines changed

Cargo.lock

Lines changed: 20 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ cgp-serde-json = { version = "0.1.0-beta", path = "./crates/cgp-serde-j
3535
cgp-serde-alloc = { version = "0.1.0-beta", path = "./crates/cgp-serde-alloc" }
3636
cgp-serde-typed-arena = { version = "0.1.0-beta", path = "./crates/cgp-serde-typed-arena" }
3737

38-
# cgp = { git = "https://github.com/contextgeneric/cgp.git" }
39-
# cgp-error-anyhow = { git = "https://github.com/contextgeneric/cgp.git" }
38+
[patch.crates-io]
39+
cgp = { git = "https://github.com/contextgeneric/cgp.git" }
40+
cgp-error-anyhow = { git = "https://github.com/contextgeneric/cgp.git" }

crates/cgp-serde-tests/src/tests/arena.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ pub struct Payload<'a> {
2525
pub coords: Vec<&'a Coord>,
2626
}
2727

28-
#[cgp_context]
2928
#[derive(HasField)]
3029
pub struct App<'a> {
3130
pub arena: &'a Arena<Coord>,
3231
}
3332

3433
delegate_components! {
35-
AppComponents {
34+
<'a> App<'a> {
3635
ErrorTypeProviderComponent:
3736
UseAnyhowError,
3837
ErrorRaiserComponent:

crates/cgp-serde-tests/src/tests/basic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ pub struct Payload {
1515
pub data: Vec<u8>,
1616
}
1717

18-
#[cgp_context]
1918
pub struct App;
2019

2120
delegate_components! {
22-
AppComponents {
21+
App {
2322
ErrorTypeProviderComponent:
2423
UseAnyhowError,
2524
ErrorRaiserComponent:

crates/cgp-serde-tests/src/tests/nested.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ pub struct MessagesArchive {
2727
pub messages_by_topics: Vec<MessagesByTopic>,
2828
}
2929

30-
#[cgp_context]
3130
pub struct AppA;
3231

3332
delegate_components! {
34-
AppAComponents {
33+
AppA {
3534
ValueSerializerComponent:
3635
UseDelegate<new SerializerComponentsA {
3736
<'a, T> &'a T:
@@ -74,11 +73,10 @@ check_components! {
7473
}
7574
}
7675

77-
#[cgp_context]
7876
pub struct AppB;
7977

8078
delegate_components! {
81-
AppBComponents {
79+
AppB {
8280
ValueSerializerComponent:
8381
UseDelegate<new SerializerComponentsB {
8482
<'a, T> &'a T:

0 commit comments

Comments
 (0)