Fix linter errors, enable ci for pull requests

This commit is contained in:
Sergey Levitin 2020-01-04 11:56:34 +03:00
parent 5f680cae50
commit 78f0bd4c0f
3 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
on: [push]
on: [push, pull_request]
name: Continuous integration

View file

@ -128,7 +128,7 @@ mod tests {
#[test]
fn test_user_mention() {
assert_eq!(
user_mention(123456789, "<pwner666>"),
user_mention(123_456_789, "<pwner666>"),
"<a href=\"tg://user?id=123456789\">&lt;pwner666&gt;</a>",
);
}

View file

@ -35,7 +35,7 @@ pub fn underline(s: &str) -> String {
// underline entity, so instead of ___italic underline___ we should use
// ___italic underline_\r__, where \r is a character with code 13, which
// will be ignored.
if s.starts_with("_") && s.ends_with("_") {
if s.starts_with('_') && s.ends_with('_') {
format!(r"__{}\r__", s)
} else {
format!("__{}__", s)
@ -168,7 +168,7 @@ mod tests {
#[test]
fn test_user_mention() {
assert_eq!(
user_mention(123456789, "pwner666"),
user_mention(123_456_789, "pwner666"),
"[pwner666](tg://user?id=123456789)"
);
}