Arachnid / solidity-stringutils

Basic string utilities for Solidity
Apache License 2.0
1.12k stars 369 forks source link

Fix shadowing warning #56

Closed minaminao closed 11 months ago

minaminao commented 1 year ago

The following warning is displayed when compiling. This PR will modify so that the warning is not displayed. See also https://github.com/ethereum/solidity/pull/12680 for more information on this style.

Warning: This declaration shadows an existing declaration.
  --> src/strings.sol:45:42:
   |
45 |     function memcpy(uint dest, uint src, uint len) private pure {
   |                                          ^^^^^^^^
Note: The shadowed declaration is here:
  --> src/strings.sol:85:5:
   |
85 |     function len(bytes32 self) internal pure returns (uint) {
   |     ^ (Relevant source part starts here and spans across multiple lines).
Note: The shadowed declaration is here:
   --> src/strings.sol:160:5:
    |
160 |     function len(slice memory self) internal pure returns (uint l) {
    |     ^ (Relevant source part starts here and spans across multiple lines).
refcell commented 1 year ago

This would be much appreciated!

radeksvarz commented 1 year ago

@RyanRHall what's holding from applying this small PR? Is there any help needed?

Sabnock01 commented 12 months ago

Would like to see this merged. Will open my own PR for it if necessary.

minaminao commented 12 months ago

Hi @Arachnid. Thanks for a great library. This library is used by many projects, and some people find it a little annoying that warnings are shown when compiling them. This PR just changes len to length. I'd appreciate it if you could merge this PR when you have time :)

Arachnid commented 11 months ago

Thanks! And sorry for the long delay.