Skip to content

Commit 1dc54b8

Browse files
committed
cargo fmt
1 parent a8181c3 commit 1dc54b8

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() -> ::std::io::Result<()> {
22
::message_parser_ffi::generate_headers()
3-
}
3+
}

message_parser_ffi/src/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,21 @@ pub fn mp_free_text_result_for_qt(result: TextResultForQt) {
6262
}
6363

6464
fn encode_link_destination(destination: &LinkDestination) -> String {
65-
let destination_data = serde_json::to_string(&destination).unwrap_or("serdejson-serialization-error".to_string());
65+
let destination_data =
66+
serde_json::to_string(&destination).unwrap_or("serdejson-serialization-error".to_string());
6667
// into username part as uri encoded
6768
format!("{}@link", urlencoding::encode(&destination_data))
6869
}
6970

7071
fn element_to_qt_html(input: &Element) -> String {
7172
match input {
7273
Element::Text(text) => escape(*text).to_string(),
73-
Element::Tag(tag) => {
74-
format!(r#""<a href="hashtag:{}">{}</a>""#, escape(*tag), escape(*tag)).to_string()
75-
}
74+
Element::Tag(tag) => format!(
75+
r#""<a href="hashtag:{}">{}</a>""#,
76+
escape(*tag),
77+
escape(*tag)
78+
)
79+
.to_string(),
7680
Element::Linebreak => "<br>".to_string(),
7781
Element::Link { destination } => format!(
7882
r#""<a href="link:{}">{}</a>""#,
@@ -158,11 +162,12 @@ pub fn mp_get_first_emoji(text: char_p_ref<'_>) -> char_p_boxed {
158162
}
159163

160164
/// Count emojis in a message, if there are only emojis.
161-
///
162-
/// This is used to display messages with only emojis in a larger font size.
165+
///
166+
/// This is used to display messages with only emojis in a larger font size.
163167
#[ffi_export]
164168
pub fn mp_count_emojis_if_only_contains_emoji(text: char_p_ref<'_>) -> u32 {
165-
deltachat_message_parser::parser::is_emoji::count_emojis_if_only_contains_emoji(text.to_str()).unwrap_or(0)
169+
deltachat_message_parser::parser::is_emoji::count_emojis_if_only_contains_emoji(text.to_str())
170+
.unwrap_or(0)
166171
}
167172

168173
/// frees a string managed by rust

0 commit comments

Comments
 (0)