Created
June 9, 2016 10:43
-
-
Save julienXX/41adf0ac2d709cce561bb21a768aabed to your computer and use it in GitHub Desktop.
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 rewrite_path(context: &RewriteContext, | |
expr_context: bool, | |
qself: Option<&ast::QSelf>, | |
path: &ast::Path, | |
width: usize, | |
offset: Indent) | |
-> Option<String> { | |
let skip_count = qself.map_or(0, |x| x.position); | |
let mut result = if path.global && qself.is_none() { | |
if path.segments.len() == 0 { | |
Some(String::new()) | |
} else { | |
Some("::".to_owned()) | |
} | |
} else { | |
None | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment