-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add hidings to skin category (adr-60) and ignore tokenId on wear…
…able urns (#179)
- Loading branch information
1 parent
296edfc
commit 6181223
Showing
6 changed files
with
155 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pub trait FindNthChar { | ||
fn find_nth_char(&self, n: i32, character: char) -> Option<usize>; | ||
} | ||
|
||
impl FindNthChar for &str { | ||
fn find_nth_char(&self, mut n: i32, character: char) -> Option<usize> { | ||
for (i, c) in self.char_indices() { | ||
if c == character { | ||
n -= 1; | ||
} | ||
if n == 0 { | ||
return Some(i); | ||
} | ||
} | ||
|
||
None | ||
} | ||
} | ||
|
||
impl FindNthChar for String { | ||
fn find_nth_char(&self, n: i32, character: char) -> Option<usize> { | ||
self.as_str().find_nth_char(n, character) | ||
} | ||
} |