Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

chore: implement Display instead of ToString #828

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

MegaRedHand
Copy link
Contributor

Description

This PR replaces StarknetChainId's ToString impl with a Display impl. From the standard library documentation:

This trait is automatically implemented for any type which implements the Display trait. As such, ToString shouldn't be implemented directly: Display should be implemented instead, and you get the ToString implementation for free.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

From the [standard library documentation](https://doc.rust-lang.org/std/string/trait.ToString.html):

> This trait is automatically implemented for any type which implements the `Display` trait. As such, `ToString` shouldn't be implemented directly: `Display` should be implemented instead, and you get the `ToString` implementation for free.
@codecov-commenter
Copy link

Codecov Report

Merging #828 (371e294) into main (5448721) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #828      +/-   ##
==========================================
- Coverage   91.76%   91.76%   -0.01%     
==========================================
  Files          54       54              
  Lines       12871    12870       -1     
==========================================
- Hits        11811    11810       -1     
  Misses       1060     1060              
Impacted Files Coverage Δ
src/definitions/block_context.rs 100.00% <100.00%> (ø)

@juanbono juanbono added this pull request to the merge queue Jul 18, 2023
Merged via the queue into main with commit 1c90f86 Jul 18, 2023
@juanbono juanbono deleted the replace-tostring-with-display branch July 31, 2023 23:37
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.

4 participants