Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

core_types: Update to 2018 edition #2012

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

timotree3
Copy link
Collaborator

@timotree3 timotree3 commented Dec 22, 2019

PR summary

This PR

  • Updates holochain_core_types's Cargo.toml to use the 2018 edition of Rust (ca02f6c)
  • Fixes the broken use declarations caused by the changes to namespacing in the 2018 edition (ca02f6c)
  • Removes most extern crates because the 2018 edition makes them unneeded (ca02f6c)
  • Deletes the remaining #[macro_use] extern crates and adds use declarations for their macros where needed (88af2fe)
  • Updates some lifetime parameters to use the new Foo<'_> notation in accordance with 2018 edition idioms (575c348)

testing/benchmarking notes

N/A

followups

I plan to make more of these for all crates that aren't 2018 in this mono-repo.

changelog

  • if this is a code change that effects some consumer (e.g. zome developers) of holochain core, then it has been added to our between-release changelog with the format
- summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)

documentation

@timotree3
Copy link
Collaborator Author

CI is failing because the use declarations that I added for the serde derives aren't working on that machine. I added use serde::{Deserialize, Serialize};, which works on my machine, but it seems that in general for that to work you need to enable the derive feature of serde.

That leaves two options:

  • Replace these instances of serde::{Deserialize, Serialize} with serde_derive::{Deserialize, Serialize}
  • Enable the derive feature of serde, removing the need for the serde_derive dependency altogether.

Personally, I prefer the second approach, as it turns code that looks like

use serde::{Deserialize, Serialize};
use serde_derive::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
struct Foo { /* ... */ }

into just

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
struct Foo { /* ... */ }

I'll be pushing a commit that uses said approach.

@timotree3
Copy link
Collaborator Author

The current CI failure seems to be cause by a regression in structopt-derive v0.3.6. I'm looking into it now.

@timotree3
Copy link
Collaborator Author

I opened TeXitoi/structopt#315. In the meantime, I suggest we mitigate this by adding an unused structopt-derive dependency with the same version as our structopt dependency. I'll push a commit that does this now.

@timotree3
Copy link
Collaborator Author

As a matter of fact, the breakage in structopt-derive v0.3.6 should be affecting the develop branch too. I'll make a PR applying the same mitigation I did here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants