This file contains hidden or 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
Item { | |
source: Span { | |
filename: Real("src/lib.rs"), | |
loline: 1, | |
locol: 0, | |
hiline: 2, | |
hicol: 23 | |
}, | |
name: Some(""), | |
attrs: Attributes { |
This file contains hidden or 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
pub fn get_pattern_source(&self, pat: &Pat) -> Option<PatternSource<'hir>> { | |
let id = // get id | |
match self.find(id) { | |
Some(NodeExpr(ref e)) => { | |
Some(PatternSource::MatchExpr(e)) | |
} | |
Some(NodeStmt(&Stmt { node: StmtDecl(ref decl, _), .. })) => { | |
match decl.clone().unwrap().node { | |
DeclLocal(ref local) => Some(PatternSource::LetDecl(local)), | |
_ => { |