Closed
Description
This code produces a warning:
#[doc = "
Returns the escaped value of the textual representation of
its arguments in a form suitable for embedding in a URL query.
# Example
``
use gtmpl::template;
let url = template(r#\"{{ urlquery \"foo bar?\" }}\"#, 0);
assert_eq!(&url.unwrap(), \"foo%20bar%3F\");
``
"]
pub fn urlquery(args: &[Arc<Value>]) -> Result<Arc<Value>, String> {
if args.len() != 1 {
return Err(String::from("urlquery requires one argument"));
}
match *args[0] {
Value::String(ref s) => Ok(varc!(
utf8_percent_encode(s, DEFAULT_ENCODE_SET).to_string()
)),
_ => Err(String::from("Arguments need to be of type String")),
}
}
warning: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> src/funcs.rs:383:1
|
383 | / #[doc = "
384 | | Returns the escaped value of the textual representation of
385 | | its arguments in a form suitable for embedding in a URL query.
386 | |
... |
393 | | "]
394 | | pub fn urlquery(args: &[Arc<Value>]) -> Result<Arc<Value>, String> {
| |_
|
= note: #[warn(empty_line_after_outer_attr)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.186/index.html#empty_line_after_outer_attr
cc @phansch
Metadata
Metadata
Assignees
Labels
No labels