Skip to content

Convert from a String in the secret test - #214

Merged
jdno merged 1 commit into
mainfrom
fix-secret-string-conversion
Aug 21, 2026
Merged

jdno merged 1 commit into
mainfrom
fix-secret-string-conversion

Conversation

@jdno

@jdno jdno commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Stacked on #213, which touches the same tests. GitHub retargets this at main once that one merges.

The test for From<String> on a secret converted from a &str:

#[test]
fn from_string_returns_secret() {
    let secret: TestSecret = "test".into();
}

So it duplicated from_str_returns_secret beside it, and the conversion it was named for went untested. It now converts from a String.

Notes for review

  • Verified by deleting impl From<String> from the secret! macro. The test now fails to compile, where before the change neither secret test noticed.
  • Only tests/secret.rs changes.

just pre-commit passes.

Base automatically changed from assert-conversion-results to main August 21, 2026 13:50
The test for `From<String>` on a secret converted from a `&str`, so it
duplicated the test beside it and left the conversion it was named for
untested. Removing the implementation from the macro did not break
either test.

It now converts from a `String`, and removing the implementation fails
to compile.
@jdno
jdno force-pushed the fix-secret-string-conversion branch from 55a0650 to 5a02902 Compare August 21, 2026 13:52
@jdno
jdno merged commit 951bf61 into main Aug 21, 2026
22 checks passed
@jdno
jdno deleted the fix-secret-string-conversion branch August 21, 2026 13:55
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.

1 participant