Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all the dead code. #153

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Conversation

daidoji
Copy link
Collaborator

@daidoji daidoji commented Oct 21, 2023

Rationale

Just trying to solve the issue to get familiar with the rust tools, the build process, and the warnings.

Simply made warnings -> errors and then removed all the dead code. This may not have been the right thing to do and if so, def let me know what I should have done :D I didn't really ask for clarity so totally glad to redo it with a little direction.

Testing

Ran the tests that were already present and none seemed to break after I removed all this code.

For Reviewers

  • Verify version bumped in Cargo.toml

@daidoji
Copy link
Collaborator Author

daidoji commented Oct 21, 2023

Also we verify that we manually bump the version in these PRs but should we also update the edition to the current year?

@daidoji daidoji mentioned this pull request Oct 21, 2023
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

Merging #153 (d9c926a) into main (43a011b) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
+ Coverage   95.39%   95.42%   +0.03%     
==========================================
  Files          32       32              
  Lines        3037     3037              
==========================================
+ Hits         2897     2898       +1     
+ Misses        140      139       -1     
Files Coverage Δ
src/core/bexter.rs 100.00% <ø> (+1.61%) ⬆️
src/core/common.rs 97.72% <ø> (ø)
src/core/prefixer.rs 98.80% <ø> (ø)
src/core/salter.rs 98.59% <ø> (ø)
src/core/serder.rs 99.21% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@jasoncolburne jasoncolburne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple comments

@@ -311,16 +311,4 @@ mod test {
assert_eq!(bexter.qb2().unwrap(), qb2);
assert_eq!(bexter.bext().unwrap(), bext);
}

fn unhappy() {
Copy link
Collaborator

@jasoncolburne jasoncolburne Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, add an #[rstest] or #[test] tag above

@@ -102,26 +102,6 @@ pub mod Ids {
const REVER_STRING: &str = "(?P<ident>[A-Z]{4})(?P<major>[0-9a-f])(?P<minor>[0-9a-f])(?P<kind>[A-Z]{4})(?P<size>[0-9a-f]{6})_";
const IDENTS: &[&str] = &[Identage::ACDC, Identage::KERI];
const SERIALS: &[&str] = &[Serialage::JSON];
const ILKS: &[&str] = &[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I use these externally

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong though, I may just use Ilkage actually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I wasn't aware that this library was in use yet. Is it consumed in one of the public WebOfTrust tools or in a private project?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's consumed by my company, Qui Identity. I have a KERI/ACDC implementation in Rust in a library we make use of.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked, I do only use Ilkage:

❯ rg ILKS .
❯ rg Ilkage .
./src/keri/verification.rs
4:use cesride::{common::Ilkage, data::Value, Matter, Sadder, Saider, Seqner, Serder};
11:        Ilkage::vcp => serder.pre(),
12:        Ilkage::iss | Ilkage::rev => serder.ked()["ri"].to_string(),

./src/keri/parsing.rs
4:    common::{Identage, Ilkage},
47:                        Ilkage::icp | Ilkage::rot | Ilkage::ixn => {
77:                        Ilkage::vcp | Ilkage::iss | Ilkage::rev => match group {
... and so forth

@@ -1,5 +1,4 @@
// TODO: remove before 1.0.0
#![allow(dead_code)]
#![deny(warnings)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simply remove this I think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I see the change. Nice

@daidoji
Copy link
Collaborator Author

daidoji commented Oct 23, 2023

Added back the unhappy function and notated it as a test.

Copy link
Collaborator

@jasoncolburne jasoncolburne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@m00sey
Copy link
Member

m00sey commented Nov 16, 2023

Closes #60

@m00sey m00sey merged commit 7cd5453 into WebOfTrust:main Nov 30, 2023
3 checks passed
@daidoji daidoji deleted the bug-60-remove-dead-code branch November 30, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants