You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[doc = "Returns the escaped value of the textual representation ofits 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\");``"]pubfnurlquery(args:&[Arc<Value>]) -> Result<Arc<Value>,String>{if args.len() != 1{returnErr(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
Thanks for the report! I managed to reduce the code a bit:
#[doc = "sometext"]pubfnfunction() -> bool{true}
Note that the function needs to return something in order to produce this false positive. This took me a while to figure out and is.. interesting. I hope to have a fix by next week 👍
This code produces a warning:
cc @phansch
The text was updated successfully, but these errors were encountered: