Merge pull request #122 from selevit/markup_utils

Fix linter errors, enable ci for pull requests
This commit is contained in:
Temirkhan Myrzamadi 2020-01-04 15:08:13 +06:00 committed by GitHub
commit 6c69635f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)"
);
}