Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teddriggs/syn-select
Lightweight path selector for searching Rust code
https://github.com/teddriggs/syn-select
rust
Last synced: 3 months ago
JSON representation
Lightweight path selector for searching Rust code
- Host: GitHub
- URL: https://github.com/teddriggs/syn-select
- Owner: TedDriggs
- License: mit
- Created: 2019-01-29T02:00:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T15:05:13.000Z (over 1 year ago)
- Last Synced: 2024-10-06T17:08:38.173Z (3 months ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 16
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# syn-select
[![Build Status](https://travis-ci.org/TedDriggs/syn-select.svg?branch=master)](https://travis-ci.org/TedDriggs/syn-select)
[![Latest Version](https://img.shields.io/crates/v/syn-select.svg)](https://crates.io/crates/syn-select)
[![Documentation](https://docs.rs/syn-select/badge.svg)](https://docs.rs/syn-select)Lightweight path selector for searching Rust code.
```rust
mod a {
mod b {
trait C {
fn d(self) {}fn f() {}
}
}
}fn main() {
let src_file = syn::parse_str(include_str!("./rs")).unwrap();// This will print out the trait `C`, limited to only function `d`.
dbg!(syn_select::select("a::b::C::d", &src_file).unwrap());
}
```# Wildcards
Using `_` as a path segment in a wildcard will match any element in that position.
For example, in the following:```rust
mod imp {
struct H;
}mod imp2 {
struct H;
}
```The selector `_::H` would match both structs named `H`.