Merge rust-bitcoin/rust-bitcoin#3821: api: Include generics in regex
7f2cf1dce8
api: Include generics in regex (Tobin C. Harding) Pull request description: The regex is still wrong, it misses structs with generics. Currently `contrib/api.sh io types` returns: ErrorKind Error Sink But with this patch applied it returns: FromStd<T> ToStd<T> ErrorKind Cursor<T> Error Sink Take<'a, R: bitcoin_io::Read + ?core::marker::Sized> Thanks ChatGPT, good robot. ACKs for top commit: storopoli: ACK7f2cf1dce8
apoelstra: ACK 7f2cf1dce8236c60931f729748c487d401878067; successfully ran local tests; nice! Tree-SHA512: 92fde9788edf8bf3e9b0639aec0aa0c4d7509c46cb048505e8018af57d671e893dccb7e0e018246438cceeb9c64232b8a0639bfe1ee7a35983b9e2bf1f2d4a4a
This commit is contained in:
commit
4cd7a5e708
|
@ -99,12 +99,12 @@ main() {
|
|||
|
||||
# Print all public structs and enums.
|
||||
structs_and_enums() {
|
||||
grep -oP 'pub (struct|enum) \K[\w:]+(?=\(|;| |$)' "$file" | sed "s/^${crate_full_name}:://"
|
||||
grep -oP 'pub (struct|enum) \K[\w:]+(?:<[^>]+>)?(?=\(|;| |$)' "$file" | sed "s/^${crate_full_name}:://"
|
||||
}
|
||||
|
||||
# Print all public structs and enums excluding error types.
|
||||
structs_and_enums_no_err() {
|
||||
grep -oP 'pub (struct|enum) \K[\w:]+(?=\(|;| |$)' "$file" | sed "s/^${crate_full_name}:://" | grep -v Error
|
||||
grep -oP 'pub (struct|enum) \K[\w:]+(?:<[^>]+>)?(?=\(|;| |$)' "$file" | sed "s/^${crate_full_name}:://" | grep -v Error
|
||||
}
|
||||
|
||||
# Print all public traits.
|
||||
|
|
Loading…
Reference in New Issue