Skip to content

Instantly share code, notes, and snippets.

@julienXX
Created June 9, 2016 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienXX/41adf0ac2d709cce561bb21a768aabed to your computer and use it in GitHub Desktop.
Save julienXX/41adf0ac2d709cce561bb21a768aabed to your computer and use it in GitHub Desktop.
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