Commit
+4634 -3380 +/-136 browse
1 | diff --git a/build.rs b/build.rs |
2 | index 7946d81..2268918 100644 |
3 | --- a/build.rs |
4 | +++ b/build.rs |
5 | @@ -37,14 +37,9 @@ fn main() { |
6 | ]); |
7 | #[cfg(feature = "cli-docs")] |
8 | { |
9 | - use flate2::Compression; |
10 | - use flate2::GzBuilder; |
11 | + use flate2::{Compression, GzBuilder}; |
12 | const MANDOC_OPTS: &[&str] = &["-T", "utf8", "-I", "os=Generated by mandoc(1)"]; |
13 | - use std::env; |
14 | - use std::fs::File; |
15 | - use std::io::prelude::*; |
16 | - use std::path::Path; |
17 | - use std::process::Command; |
18 | + use std::{env, fs::File, io::prelude::*, path::Path, process::Command}; |
19 | |
20 | let out_dir = env::var("OUT_DIR").unwrap(); |
21 | let mut out_dir_path = Path::new(&out_dir).to_path_buf(); |
22 | @@ -57,7 +52,8 @@ fn main() { |
23 | .output() |
24 | .or_else(|_| Command::new("man").arg("-l").arg(filepath).output()) |
25 | .expect( |
26 | - "could not execute `mandoc` or `man`. If the binaries are not available in the PATH, disable `cli-docs` feature to be able to continue compilation.", |
27 | + "could not execute `mandoc` or `man`. If the binaries are not available in \ |
28 | + the PATH, disable `cli-docs` feature to be able to continue compilation.", |
29 | ); |
30 | |
31 | let file = File::create(&out_dir_path).unwrap_or_else(|err| { |
32 | diff --git a/config_macros.rs b/config_macros.rs |
33 | index 1c8e40c..ce0ea75 100644 |
34 | --- a/config_macros.rs |
35 | +++ b/config_macros.rs |
36 | @@ -19,9 +19,11 @@ |
37 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
38 | */ |
39 | |
40 | - use std::fs::File; |
41 | - use std::io::prelude::*; |
42 | - use std::process::{Command, Stdio}; |
43 | + use std::{ |
44 | + fs::File, |
45 | + io::prelude::*, |
46 | + process::{Command, Stdio}, |
47 | + }; |
48 | |
49 | use quote::{format_ident, quote}; |
50 | |
51 | @@ -29,7 +31,8 @@ use quote::{format_ident, quote}; |
52 | pub fn override_derive(filenames: &[(&str, &str)]) { |
53 | let mut output_file = |
54 | File::create("src/conf/overrides.rs").expect("Unable to open output file"); |
55 | - let mut output_string = r##"/* |
56 | + let mut output_string = r##"// @generated |
57 | + /* |
58 | * meli - conf/overrides.rs |
59 | * |
60 | * Copyright 2020 Manos Pitsidianakis |
61 | @@ -60,7 +63,7 @@ use super::*; |
62 | |
63 | 'file_loop: for (filename, ident) in filenames { |
64 | println!("cargo:rerun-if-changed={}", filename); |
65 | - let mut file = File::open(&filename) |
66 | + let mut file = File::open(filename) |
67 | .unwrap_or_else(|err| panic!("Unable to open file `{}` {}", filename, err)); |
68 | |
69 | let mut src = String::new(); |
70 | diff --git a/melib/build.rs b/melib/build.rs |
71 | index b6ddfcd..659e6eb 100644 |
72 | --- a/melib/build.rs |
73 | +++ b/melib/build.rs |
74 | @@ -29,11 +29,12 @@ fn main() -> Result<(), std::io::Error> { |
75 | println!("cargo:rerun-if-changed=build.rs"); |
76 | println!("cargo:rerun-if-changed={}", MOD_PATH); |
77 | /* Line break tables */ |
78 | - use std::fs::File; |
79 | - use std::io::prelude::*; |
80 | - use std::io::BufReader; |
81 | - use std::path::Path; |
82 | - use std::process::{Command, Stdio}; |
83 | + use std::{ |
84 | + fs::File, |
85 | + io::{prelude::*, BufReader}, |
86 | + path::Path, |
87 | + process::{Command, Stdio}, |
88 | + }; |
89 | const LINE_BREAK_TABLE_URL: &str = |
90 | "http://www.unicode.org/Public/UCD/latest/ucd/LineBreak.txt"; |
91 | /* Grapheme width tables */ |
92 | @@ -52,7 +53,7 @@ fn main() -> Result<(), std::io::Error> { |
93 | std::process::exit(0); |
94 | } |
95 | let mut child = Command::new("curl") |
96 | - .args(&["-o", "-", LINE_BREAK_TABLE_URL]) |
97 | + .args(["-o", "-", LINE_BREAK_TABLE_URL]) |
98 | .stdout(Stdio::piped()) |
99 | .stdin(Stdio::null()) |
100 | .stderr(Stdio::inherit()) |
101 | @@ -69,7 +70,8 @@ fn main() -> Result<(), std::io::Error> { |
102 | let tokens: &str = line.split_whitespace().next().unwrap(); |
103 | |
104 | let semicolon_idx: usize = tokens.chars().position(|c| c == ';').unwrap(); |
105 | - /* LineBreak.txt list is ascii encoded so we can assume each char takes one byte: */ |
106 | + /* LineBreak.txt list is ascii encoded so we can assume each char takes one |
107 | + * byte: */ |
108 | let chars_str: &str = &tokens[..semicolon_idx]; |
109 | |
110 | let mut codepoint_iter = chars_str.split(".."); |
111 | @@ -87,21 +89,21 @@ fn main() -> Result<(), std::io::Error> { |
112 | child.wait()?; |
113 | |
114 | let child = Command::new("curl") |
115 | - .args(&["-o", "-", UNICODE_DATA_URL]) |
116 | + .args(["-o", "-", UNICODE_DATA_URL]) |
117 | .stdout(Stdio::piped()) |
118 | .output()?; |
119 | |
120 | let unicode_data = String::from_utf8_lossy(&child.stdout); |
121 | |
122 | let child = Command::new("curl") |
123 | - .args(&["-o", "-", EAW_URL]) |
124 | + .args(["-o", "-", EAW_URL]) |
125 | .stdout(Stdio::piped()) |
126 | .output()?; |
127 | |
128 | let eaw_data = String::from_utf8_lossy(&child.stdout); |
129 | |
130 | let child = Command::new("curl") |
131 | - .args(&["-o", "-", EMOJI_DATA_URL]) |
132 | + .args(["-o", "-", EMOJI_DATA_URL]) |
133 | .stdout(Stdio::piped()) |
134 | .output()?; |
135 | |
136 | @@ -198,13 +200,13 @@ fn main() -> Result<(), std::io::Error> { |
137 | } |
138 | // Apply the following special cases: |
139 | // - The unassigned code points in the following blocks default to "W": |
140 | - // CJK Unified Ideographs Extension A: U+3400..U+4DBF |
141 | - // CJK Unified Ideographs: U+4E00..U+9FFF |
142 | - // CJK Compatibility Ideographs: U+F900..U+FAFF |
143 | - // - All undesignated code points in Planes 2 and 3, whether inside or |
144 | - // outside of allocated blocks, default to "W": |
145 | - // Plane 2: U+20000..U+2FFFD |
146 | - // Plane 3: U+30000..U+3FFFD |
147 | + // - CJK Unified Ideographs Extension A: U+3400..U+4DBF |
148 | + // - CJK Unified Ideographs: U+4E00..U+9FFF |
149 | + // - CJK Compatibility Ideographs: U+F900..U+FAFF |
150 | + // - All undesignated code points in Planes 2 and 3, whether inside or outside |
151 | + // of allocated blocks, default to "W": |
152 | + // - Plane 2: U+20000..U+2FFFD |
153 | + // - Plane 3: U+30000..U+3FFFD |
154 | const WIDE_RANGES: [(usize, usize); 5] = [ |
155 | (0x3400, 0x4DBF), |
156 | (0x4E00, 0x9FFF), |
157 | @@ -245,12 +247,12 @@ fn main() -> Result<(), std::io::Error> { |
158 | } |
159 | |
160 | use std::str::FromStr; |
161 | - let mut v = comment.trim().split_whitespace().next().unwrap(); |
162 | + let mut v = comment.split_whitespace().next().unwrap(); |
163 | if v.starts_with('E') { |
164 | v = &v[1..]; |
165 | } |
166 | if v.as_bytes() |
167 | - .get(0) |
168 | + .first() |
169 | .map(|c| !c.is_ascii_digit()) |
170 | .unwrap_or(true) |
171 | { |
172 | @@ -325,7 +327,7 @@ fn main() -> Result<(), std::io::Error> { |
173 | } |
174 | } |
175 | |
176 | - let mut file = File::create(&mod_path)?; |
177 | + let mut file = File::create(mod_path)?; |
178 | file.write_all( |
179 | br#"/* |
180 | * meli - text_processing crate. |
181 | diff --git a/melib/src/addressbook.rs b/melib/src/addressbook.rs |
182 | index 42867d0..64374e6 100644 |
183 | --- a/melib/src/addressbook.rs |
184 | +++ b/melib/src/addressbook.rs |
185 | @@ -24,12 +24,14 @@ pub mod vcard; |
186 | |
187 | pub mod mutt; |
188 | |
189 | - use crate::datetime::{self, UnixTimestamp}; |
190 | - use crate::parsec::Parser; |
191 | - use std::collections::HashMap; |
192 | + use std::{collections::HashMap, ops::Deref}; |
193 | + |
194 | use uuid::Uuid; |
195 | |
196 | - use std::ops::Deref; |
197 | + use crate::{ |
198 | + datetime::{self, UnixTimestamp}, |
199 | + parsec::Parser, |
200 | + }; |
201 | |
202 | #[derive(Hash, Debug, PartialEq, Eq, Clone, Copy, Deserialize, Serialize)] |
203 | #[serde(from = "String")] |
204 | @@ -85,7 +87,8 @@ pub struct Card { |
205 | last_edited: UnixTimestamp, |
206 | extra_properties: HashMap<String, String>, |
207 | |
208 | - /// If true, we can't make any changes because we do not manage this resource. |
209 | + /// If true, we can't make any changes because we do not manage this |
210 | + /// resource. |
211 | external_resource: bool, |
212 | } |
213 | |
214 | diff --git a/melib/src/addressbook/mutt.rs b/melib/src/addressbook/mutt.rs |
215 | index 805c354..59cb4ff 100644 |
216 | --- a/melib/src/addressbook/mutt.rs |
217 | +++ b/melib/src/addressbook/mutt.rs |
218 | @@ -20,11 +20,11 @@ |
219 | */ |
220 | |
221 | //! # Mutt contact formats |
222 | - //! |
223 | + |
224 | + use std::collections::VecDeque; |
225 | |
226 | use super::*; |
227 | use crate::parsec::{is_not, map_res, match_literal_anycase, prefix, Parser}; |
228 | - use std::collections::VecDeque; |
229 | |
230 | //alias <nickname> [ <long name> ] <address> |
231 | // From mutt doc: |
232 | diff --git a/melib/src/addressbook/vcard.rs b/melib/src/addressbook/vcard.rs |
233 | index 2556b6d..90c19a2 100644 |
234 | --- a/melib/src/addressbook/vcard.rs |
235 | +++ b/melib/src/addressbook/vcard.rs |
236 | @@ -27,11 +27,13 @@ |
237 | //! - Version 4 [RFC 6350: vCard Format Specification](https://datatracker.ietf.org/doc/rfc6350/) |
238 | //! - Parameter escaping [RFC 6868 Parameter Value Encoding in iCalendar and vCard](https://datatracker.ietf.org/doc/rfc6868/) |
239 | |
240 | + use std::{collections::HashMap, convert::TryInto}; |
241 | + |
242 | use super::*; |
243 | - use crate::error::{Error, Result}; |
244 | - use crate::parsec::{match_literal_anycase, one_or_more, peek, prefix, take_until, Parser}; |
245 | - use std::collections::HashMap; |
246 | - use std::convert::TryInto; |
247 | + use crate::{ |
248 | + error::{Error, Result}, |
249 | + parsec::{match_literal_anycase, one_or_more, peek, prefix, take_until, Parser}, |
250 | + }; |
251 | |
252 | /* Supported vcard versions */ |
253 | pub trait VCardVersion: core::fmt::Debug {} |
254 | @@ -86,7 +88,11 @@ impl CardDeserializer { |
255 | input = if (!input.starts_with(HEADER_CRLF) || !input.ends_with(FOOTER_CRLF)) |
256 | && (!input.starts_with(HEADER_LF) || !input.ends_with(FOOTER_LF)) |
257 | { |
258 | - return Err(Error::new(format!("Error while parsing vcard: input does not start or end with correct header and footer. input is:\n{:?}", input))); |
259 | + return Err(Error::new(format!( |
260 | + "Error while parsing vcard: input does not start or end with correct header and \ |
261 | + footer. input is:\n{:?}", |
262 | + input |
263 | + ))); |
264 | } else if input.starts_with(HEADER_CRLF) { |
265 | &input[HEADER_CRLF.len()..input.len() - FOOTER_CRLF.len()] |
266 | } else { |
267 | diff --git a/melib/src/backends.rs b/melib/src/backends.rs |
268 | index be7e8c8..dde57ed 100644 |
269 | --- a/melib/src/backends.rs |
270 | +++ b/melib/src/backends.rs |
271 | @@ -36,35 +36,41 @@ pub mod jmap; |
272 | pub mod maildir; |
273 | #[cfg(feature = "mbox_backend")] |
274 | pub mod mbox; |
275 | + use std::{ |
276 | + any::Any, |
277 | + borrow::Cow, |
278 | + collections::{BTreeSet, HashMap}, |
279 | + fmt, |
280 | + fmt::Debug, |
281 | + future::Future, |
282 | + ops::Deref, |
283 | + pin::Pin, |
284 | + sync::{Arc, RwLock}, |
285 | + }; |
286 | + |
287 | + use futures::stream::Stream; |
288 | + |
289 | #[cfg(feature = "imap_backend")] |
290 | pub use self::imap::ImapType; |
291 | - #[cfg(feature = "imap_backend")] |
292 | - pub use self::nntp::NntpType; |
293 | - use crate::conf::AccountSettings; |
294 | - use crate::error::{Error, ErrorKind, Result}; |
295 | - |
296 | #[cfg(feature = "maildir_backend")] |
297 | use self::maildir::MaildirType; |
298 | #[cfg(feature = "mbox_backend")] |
299 | use self::mbox::MboxType; |
300 | + #[cfg(feature = "imap_backend")] |
301 | + pub use self::nntp::NntpType; |
302 | use super::email::{Envelope, EnvelopeHash, Flag}; |
303 | - use futures::stream::Stream; |
304 | - use std::any::Any; |
305 | - use std::borrow::Cow; |
306 | - use std::collections::BTreeSet; |
307 | - use std::collections::HashMap; |
308 | - use std::fmt; |
309 | - use std::fmt::Debug; |
310 | - use std::future::Future; |
311 | - use std::ops::Deref; |
312 | - use std::pin::Pin; |
313 | - use std::sync::{Arc, RwLock}; |
314 | + use crate::{ |
315 | + conf::AccountSettings, |
316 | + error::{Error, ErrorKind, Result}, |
317 | + }; |
318 | |
319 | #[macro_export] |
320 | macro_rules! get_path_hash { |
321 | ($path:expr) => {{ |
322 | - use std::collections::hash_map::DefaultHasher; |
323 | - use std::hash::{Hash, Hasher}; |
324 | + use std::{ |
325 | + collections::hash_map::DefaultHasher, |
326 | + hash::{Hash, Hasher}, |
327 | + }; |
328 | let mut hasher = DefaultHasher::new(); |
329 | $path.hash(&mut hasher); |
330 | hasher.finish() |
331 | @@ -97,10 +103,13 @@ impl Default for Backends { |
332 | } |
333 | |
334 | #[cfg(feature = "notmuch_backend")] |
335 | - pub const NOTMUCH_ERROR_MSG: &str = |
336 | - "libnotmuch5 was not found in your system. Make sure it is installed and in the library paths. For a custom file path, use `library_file_path` setting in your notmuch account.\n"; |
337 | + pub const NOTMUCH_ERROR_MSG: &str = "libnotmuch5 was not found in your system. Make sure it is \ |
338 | + installed and in the library paths. For a custom file path, \ |
339 | + use `library_file_path` setting in your notmuch account.\n"; |
340 | #[cfg(not(feature = "notmuch_backend"))] |
341 | - pub const NOTMUCH_ERROR_MSG: &str = "this version of meli is not compiled with notmuch support. Use an appropriate version and make sure libnotmuch5 is installed and in the library paths.\n"; |
342 | + pub const NOTMUCH_ERROR_MSG: &str = "this version of meli is not compiled with notmuch support. \ |
343 | + Use an appropriate version and make sure libnotmuch5 is \ |
344 | + installed and in the library paths.\n"; |
345 | |
346 | #[cfg(not(feature = "notmuch_backend"))] |
347 | pub const NOTMUCH_ERROR_DETAILS: &str = ""; |
348 | @@ -432,13 +441,14 @@ pub trait MailBackend: ::std::fmt::Debug + Send + Sync { |
349 | } |
350 | } |
351 | |
352 | - /// A `BackendOp` manages common operations for the various mail backends. They only live for the |
353 | - /// duration of the operation. They are generated by the `operation` method of `Mailbackend` trait. |
354 | + /// A `BackendOp` manages common operations for the various mail backends. They |
355 | + /// only live for the duration of the operation. They are generated by the |
356 | + /// `operation` method of `Mailbackend` trait. |
357 | /// |
358 | /// # Motivation |
359 | /// |
360 | - /// We need a way to do various operations on individual mails regardless of what backend they come |
361 | - /// from (eg local or imap). |
362 | + /// We need a way to do various operations on individual mails regardless of |
363 | + /// what backend they come from (eg local or imap). |
364 | /// |
365 | /// # Creation |
366 | /// ```ignore |
367 | @@ -474,8 +484,8 @@ pub trait BackendOp: ::std::fmt::Debug + ::std::marker::Send { |
368 | |
369 | /// Wrapper for BackendOps that are to be set read-only. |
370 | /// |
371 | - /// Warning: Backend implementations may still cause side-effects (for example IMAP can set the |
372 | - /// Seen flag when fetching an envelope) |
373 | + /// Warning: Backend implementations may still cause side-effects (for example |
374 | + /// IMAP can set the Seen flag when fetching an envelope) |
375 | #[derive(Debug)] |
376 | pub struct ReadOnlyOp { |
377 | op: Box<dyn BackendOp>, |
378 | diff --git a/melib/src/backends/imap.rs b/melib/src/backends/imap.rs |
379 | index b987963..b356f4b 100644 |
380 | --- a/melib/src/backends/imap.rs |
381 | +++ b/melib/src/backends/imap.rs |
382 | @@ -36,26 +36,29 @@ use cache::{ImapCacheReset, ModSequence}; |
383 | pub mod managesieve; |
384 | mod untagged; |
385 | |
386 | - use crate::backends::{ |
387 | - RefreshEventKind::{self, *}, |
388 | - *, |
389 | + use std::{ |
390 | + collections::{hash_map::DefaultHasher, BTreeSet, HashMap, HashSet}, |
391 | + convert::TryFrom, |
392 | + hash::Hasher, |
393 | + pin::Pin, |
394 | + str::FromStr, |
395 | + sync::{Arc, Mutex}, |
396 | + time::{Duration, SystemTime}, |
397 | }; |
398 | |
399 | - use crate::collection::Collection; |
400 | - use crate::conf::AccountSettings; |
401 | - use crate::connections::timeout; |
402 | - use crate::email::{parser::BytesExt, *}; |
403 | - use crate::error::{Error, Result, ResultIntoError}; |
404 | - use futures::lock::Mutex as FutureMutex; |
405 | - use futures::stream::Stream; |
406 | - use std::collections::hash_map::DefaultHasher; |
407 | - use std::collections::{BTreeSet, HashMap, HashSet}; |
408 | - use std::convert::TryFrom; |
409 | - use std::hash::Hasher; |
410 | - use std::pin::Pin; |
411 | - use std::str::FromStr; |
412 | - use std::sync::{Arc, Mutex}; |
413 | - use std::time::{Duration, SystemTime}; |
414 | + use futures::{lock::Mutex as FutureMutex, stream::Stream}; |
415 | + |
416 | + use crate::{ |
417 | + backends::{ |
418 | + RefreshEventKind::{self, *}, |
419 | + *, |
420 | + }, |
421 | + collection::Collection, |
422 | + conf::AccountSettings, |
423 | + connections::timeout, |
424 | + email::{parser::BytesExt, *}, |
425 | + error::{Error, Result, ResultIntoError}, |
426 | + }; |
427 | |
428 | pub type ImapNum = usize; |
429 | pub type UID = ImapNum; |
430 | @@ -340,7 +343,8 @@ impl MailBackend for ImapType { |
431 | cache_handle, |
432 | }; |
433 | |
434 | - /* do this in a closure to prevent recursion limit error in async_stream macro */ |
435 | + /* do this in a closure to prevent recursion limit error in async_stream |
436 | + * macro */ |
437 | let prepare_cl = |f: &ImapMailbox| { |
438 | f.set_warm(true); |
439 | if let Ok(mut exists) = f.exists.lock() { |
440 | @@ -526,15 +530,15 @@ impl MailBackend for ImapType { |
441 | } |
442 | |
443 | fn operation(&self, hash: EnvelopeHash) -> Result<Box<dyn BackendOp>> { |
444 | - let (uid, mailbox_hash) = if let Some(v) = |
445 | - self.uid_store.hash_index.lock().unwrap().get(&hash) |
446 | - { |
447 | - *v |
448 | - } else { |
449 | - return Err(Error::new( |
450 | - "Message not found in local cache, it might have been deleted before you requested it." |
451 | + let (uid, mailbox_hash) = |
452 | + if let Some(v) = self.uid_store.hash_index.lock().unwrap().get(&hash) { |
453 | + *v |
454 | + } else { |
455 | + return Err(Error::new( |
456 | + "Message not found in local cache, it might have been deleted before you \ |
457 | + requested it.", |
458 | )); |
459 | - }; |
460 | + }; |
461 | Ok(Box::new(ImapOp::new( |
462 | uid, |
463 | mailbox_hash, |
464 | @@ -749,8 +753,20 @@ impl MailBackend for ImapType { |
465 | cmd.push_str("\\Draft "); |
466 | } |
467 | Ok(_) => { |
468 | - crate::log(format!("Application error: more than one flag bit set in set_flags: {:?}", flags), crate::ERROR); |
469 | - return Err(Error::new(format!("Application error: more than one flag bit set in set_flags: {:?}", flags)).set_kind(crate::ErrorKind::Bug)); |
470 | + crate::log( |
471 | + format!( |
472 | + "Application error: more than one flag bit set in \ |
473 | + set_flags: {:?}", |
474 | + flags |
475 | + ), |
476 | + crate::ERROR, |
477 | + ); |
478 | + return Err(Error::new(format!( |
479 | + "Application error: more than one flag bit set in set_flags: \ |
480 | + {:?}", |
481 | + flags |
482 | + )) |
483 | + .set_kind(crate::ErrorKind::Bug)); |
484 | } |
485 | Err(tag) => { |
486 | let hash = TagHash::from_bytes(tag.as_bytes()); |
487 | @@ -812,13 +828,17 @@ impl MailBackend for ImapType { |
488 | Ok(_) => { |
489 | crate::log( |
490 | format!( |
491 | - "Application error: more than one flag bit set in set_flags: {:?}", flags |
492 | - ), |
493 | + "Application error: more than one flag bit set in \ |
494 | + set_flags: {:?}", |
495 | + flags |
496 | + ), |
497 | crate::ERROR, |
498 | ); |
499 | return Err(Error::new(format!( |
500 | - "Application error: more than one flag bit set in set_flags: {:?}", flags |
501 | - ))); |
502 | + "Application error: more than one flag bit set in set_flags: \ |
503 | + {:?}", |
504 | + flags |
505 | + ))); |
506 | } |
507 | Err(tag) => { |
508 | cmd.push_str(tag); |
509 | @@ -892,16 +912,17 @@ impl MailBackend for ImapType { |
510 | Ok(Box::pin(async move { |
511 | /* Must transform path to something the IMAP server will accept |
512 | * |
513 | - * Each root mailbox has a hierarchy delimeter reported by the LIST entry. All paths |
514 | - * must use this delimeter to indicate children of this mailbox. |
515 | + * Each root mailbox has a hierarchy delimeter reported by the LIST entry. |
516 | + * All paths must use this delimeter to indicate children of this |
517 | + * mailbox. |
518 | * |
519 | - * A new root mailbox should have the default delimeter, which can be found out by issuing |
520 | - * an empty LIST command as described in RFC3501: |
521 | + * A new root mailbox should have the default delimeter, which can be found |
522 | + * out by issuing an empty LIST command as described in RFC3501: |
523 | * C: A101 LIST "" "" |
524 | * S: * LIST (\Noselect) "/" "" |
525 | * |
526 | - * The default delimiter for us is '/' just like UNIX paths. I apologise if this |
527 | - * decision is unpleasant for you. |
528 | + * The default delimiter for us is '/' just like UNIX paths. I apologise if |
529 | + * this decision is unpleasant for you. |
530 | */ |
531 | |
532 | { |
533 | @@ -924,8 +945,8 @@ impl MailBackend for ImapType { |
534 | } |
535 | } |
536 | |
537 | - /* FIXME Do not try to CREATE a sub-mailbox in a mailbox that has the \Noinferiors |
538 | - * flag set. */ |
539 | + /* FIXME Do not try to CREATE a sub-mailbox in a mailbox |
540 | + * that has the \Noinferiors flag set. */ |
541 | } |
542 | |
543 | let mut response = Vec::with_capacity(8 * 1024); |
544 | @@ -950,7 +971,17 @@ impl MailBackend for ImapType { |
545 | ret?; |
546 | let new_hash = MailboxHash::from_bytes(path.as_str().as_bytes()); |
547 | uid_store.mailboxes.lock().await.clear(); |
548 | - Ok((new_hash, new_mailbox_fut?.await.map_err(|err| Error::new(format!("Mailbox create was succesful (returned `{}`) but listing mailboxes afterwards returned `{}`", String::from_utf8_lossy(&response), err)))?)) |
549 | + Ok(( |
550 | + new_hash, |
551 | + new_mailbox_fut?.await.map_err(|err| { |
552 | + Error::new(format!( |
553 | + "Mailbox create was succesful (returned `{}`) but listing mailboxes \ |
554 | + afterwards returned `{}`", |
555 | + String::from_utf8_lossy(&response), |
556 | + err |
557 | + )) |
558 | + })?, |
559 | + )) |
560 | })) |
561 | } |
562 | |
563 | @@ -970,7 +1001,12 @@ impl MailBackend for ImapType { |
564 | imap_path = mailboxes[&mailbox_hash].imap_path().to_string(); |
565 | let permissions = mailboxes[&mailbox_hash].permissions(); |
566 | if !permissions.delete_mailbox { |
567 | - return Err(Error::new(format!("You do not have permission to delete `{}`. Set permissions for this mailbox are {}", mailboxes[&mailbox_hash].name(), permissions))); |
568 | + return Err(Error::new(format!( |
569 | + "You do not have permission to delete `{}`. Set permissions for this \ |
570 | + mailbox are {}", |
571 | + mailboxes[&mailbox_hash].name(), |
572 | + permissions |
573 | + ))); |
574 | } |
575 | } |
576 | let mut response = Vec::with_capacity(8 * 1024); |
577 | @@ -998,7 +1034,15 @@ impl MailBackend for ImapType { |
578 | let ret: Result<()> = ImapResponse::try_from(response.as_slice())?.into(); |
579 | ret?; |
580 | uid_store.mailboxes.lock().await.clear(); |
581 | - new_mailbox_fut?.await.map_err(|err| format!("Mailbox delete was succesful (returned `{}`) but listing mailboxes afterwards returned `{}`", String::from_utf8_lossy(&response), err).into()) |
582 | + new_mailbox_fut?.await.map_err(|err| { |
583 | + format!( |
584 | + "Mailbox delete was succesful (returned `{}`) but listing mailboxes \ |
585 | + afterwards returned `{}`", |
586 | + String::from_utf8_lossy(&response), |
587 | + err |
588 | + ) |
589 | + .into() |
590 | + }) |
591 | })) |
592 | } |
593 | |
594 | @@ -1064,7 +1108,12 @@ impl MailBackend for ImapType { |
595 | let mailboxes = uid_store.mailboxes.lock().await; |
596 | let permissions = mailboxes[&mailbox_hash].permissions(); |
597 | if !permissions.delete_mailbox { |
598 | - return Err(Error::new(format!("You do not have permission to rename mailbox `{}` (rename is equivalent to delete + create). Set permissions for this mailbox are {}", mailboxes[&mailbox_hash].name(), permissions))); |
599 | + return Err(Error::new(format!( |
600 | + "You do not have permission to rename mailbox `{}` (rename is equivalent \ |
601 | + to delete + create). Set permissions for this mailbox are {}", |
602 | + mailboxes[&mailbox_hash].name(), |
603 | + permissions |
604 | + ))); |
605 | } |
606 | if mailboxes[&mailbox_hash].separator != b'/' { |
607 | new_path = new_path.replace( |
608 | @@ -1089,7 +1138,14 @@ impl MailBackend for ImapType { |
609 | let ret: Result<()> = ImapResponse::try_from(response.as_slice())?.into(); |
610 | ret?; |
611 | uid_store.mailboxes.lock().await.clear(); |
612 | - new_mailbox_fut?.await.map_err(|err| format!("Mailbox rename was succesful (returned `{}`) but listing mailboxes afterwards returned `{}`", String::from_utf8_lossy(&response), err))?; |
613 | + new_mailbox_fut?.await.map_err(|err| { |
614 | + format!( |
615 | + "Mailbox rename was succesful (returned `{}`) but listing mailboxes \ |
616 | + afterwards returned `{}`", |
617 | + String::from_utf8_lossy(&response), |
618 | + err |
619 | + ) |
620 | + })?; |
621 | Ok(BackendMailbox::clone( |
622 | &uid_store.mailboxes.lock().await[&new_hash], |
623 | )) |
624 | @@ -1107,7 +1163,12 @@ impl MailBackend for ImapType { |
625 | let mailboxes = uid_store.mailboxes.lock().await; |
626 | let permissions = mailboxes[&mailbox_hash].permissions(); |
627 | if !permissions.change_permissions { |
628 | - return Err(Error::new(format!("You do not have permission to change permissions for mailbox `{}`. Set permissions for this mailbox are {}", mailboxes[&mailbox_hash].name(), permissions))); |
629 | + return Err(Error::new(format!( |
630 | + "You do not have permission to change permissions for mailbox `{}`. Set \ |
631 | + permissions for this mailbox are {}", |
632 | + mailboxes[&mailbox_hash].name(), |
633 | + permissions |
634 | + ))); |
635 | } |
636 | |
637 | Err(Error::new("Unimplemented.")) |
638 | @@ -1262,7 +1323,8 @@ impl ImapType { |
639 | |
640 | if use_oauth2 && !s.extra.contains_key("server_password_command") { |
641 | return Err(Error::new(format!( |
642 | - "({}) `use_oauth2` use requires `server_password_command` set with a command that returns an OAUTH2 token. Consult documentation for guidance.", |
643 | + "({}) `use_oauth2` use requires `server_password_command` set with a command that \ |
644 | + returns an OAUTH2 token. Consult documentation for guidance.", |
645 | s.name, |
646 | ))); |
647 | } |
648 | @@ -1524,14 +1586,16 @@ impl ImapType { |
649 | if !s.extra.contains_key("server_password_command") { |
650 | if use_oauth2 { |
651 | return Err(Error::new(format!( |
652 | - "({}) `use_oauth2` use requires `server_password_command` set with a command that returns an OAUTH2 token. Consult documentation for guidance.", |
653 | + "({}) `use_oauth2` use requires `server_password_command` set with a command \ |
654 | + that returns an OAUTH2 token. Consult documentation for guidance.", |
655 | s.name, |
656 | ))); |
657 | } |
658 | get_conf_val!(s["server_password"])?; |
659 | } else if s.extra.contains_key("server_password") { |
660 | return Err(Error::new(format!( |
661 | - "Configuration error ({}): both server_password and server_password_command are set, cannot choose", |
662 | + "Configuration error ({}): both server_password and server_password_command are \ |
663 | + set, cannot choose", |
664 | s.name.as_str(), |
665 | ))); |
666 | } |
667 | @@ -1541,7 +1605,8 @@ impl ImapType { |
668 | let use_starttls = get_conf_val!(s["use_starttls"], false)?; |
669 | if !use_tls && use_starttls { |
670 | return Err(Error::new(format!( |
671 | - "Configuration error ({}): incompatible use_tls and use_starttls values: use_tls = false, use_starttls = true", |
672 | + "Configuration error ({}): incompatible use_tls and use_starttls values: use_tls \ |
673 | + = false, use_starttls = true", |
674 | s.name.as_str(), |
675 | ))); |
676 | } |
677 | @@ -1565,7 +1630,8 @@ impl ImapType { |
678 | #[cfg(not(feature = "deflate_compression"))] |
679 | if s.extra.contains_key("use_deflate") { |
680 | return Err(Error::new(format!( |
681 | - "Configuration error ({}): setting `use_deflate` is set but this version of meli isn't compiled with DEFLATE support.", |
682 | + "Configuration error ({}): setting `use_deflate` is set but this version of meli \ |
683 | + isn't compiled with DEFLATE support.", |
684 | s.name.as_str(), |
685 | ))); |
686 | } |
687 | @@ -1578,8 +1644,10 @@ impl ImapType { |
688 | let diff = extra_keys.difference(&keys).collect::<Vec<&&str>>(); |
689 | if !diff.is_empty() { |
690 | return Err(Error::new(format!( |
691 | - "Configuration error ({}): the following flags are set but are not recognized: {:?}.", |
692 | - s.name.as_str(), diff |
693 | + "Configuration error ({}): the following flags are set but are not recognized: \ |
694 | + {:?}.", |
695 | + s.name.as_str(), |
696 | + diff |
697 | ))); |
698 | } |
699 | Ok(()) |
700 | @@ -1658,7 +1726,14 @@ async fn fetch_hlpr(state: &mut FetchState) -> Result<Vec<Envelope>> { |
701 | /* Try resetting the database */ |
702 | if let Some(ref mut cache_handle) = state.cache_handle { |
703 | if let Err(err) = cache_handle.reset() { |
704 | - crate::log(format!("IMAP cache error: could not reset cache for {}. Reason: {}", state.uid_store.account_name, err), crate::ERROR); |
705 | + crate::log( |
706 | + format!( |
707 | + "IMAP cache error: could not reset cache for {}. Reason: \ |
708 | + {}", |
709 | + state.uid_store.account_name, err |
710 | + ), |
711 | + crate::ERROR, |
712 | + ); |
713 | } |
714 | } |
715 | state.stage = FetchStage::InitialFresh; |
716 | @@ -1743,11 +1818,14 @@ async fn fetch_hlpr(state: &mut FetchState) -> Result<Vec<Envelope>> { |
717 | if max_uid_left > 0 { |
718 | debug!("{} max_uid_left= {}", mailbox_hash, max_uid_left); |
719 | let command = if max_uid_left == 1 { |
720 | - "UID FETCH 1 (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)".to_string() |
721 | + "UID FETCH 1 (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \ |
722 | + BODYSTRUCTURE)" |
723 | + .to_string() |
724 | } else { |
725 | format!( |
726 | - "UID FETCH {}:{} (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)", |
727 | - std::cmp::max(max_uid_left.saturating_sub(chunk_size), 1), |
728 | + "UID FETCH {}:{} (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS \ |
729 | + (REFERENCES)] BODYSTRUCTURE)", |
730 | + std::cmp::max(max_uid_left.saturating_sub(chunk_size), 1), |
731 | max_uid_left |
732 | ) |
733 | }; |
734 | diff --git a/melib/src/backends/imap/cache.rs b/melib/src/backends/imap/cache.rs |
735 | index f0bca45..3046ab1 100644 |
736 | --- a/melib/src/backends/imap/cache.rs |
737 | +++ b/melib/src/backends/imap/cache.rs |
738 | @@ -21,12 +21,13 @@ |
739 | |
740 | use super::*; |
741 | mod sync; |
742 | + use std::convert::TryFrom; |
743 | + |
744 | use crate::{ |
745 | backends::MailboxHash, |
746 | email::{Envelope, EnvelopeHash}, |
747 | error::*, |
748 | }; |
749 | - use std::convert::TryFrom; |
750 | |
751 | #[derive(Debug, PartialEq, Hash, Eq, Ord, PartialOrd, Copy, Clone)] |
752 | pub struct ModSequence(pub std::num::NonZeroU64); |
753 | @@ -105,10 +106,11 @@ pub use sqlite3_m::*; |
754 | #[cfg(feature = "sqlite3")] |
755 | mod sqlite3_m { |
756 | use super::*; |
757 | - use crate::sqlite3::rusqlite::types::{ |
758 | - FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, |
759 | + use crate::sqlite3::{ |
760 | + self, |
761 | + rusqlite::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput}, |
762 | + DatabaseDescription, |
763 | }; |
764 | - use crate::sqlite3::{self, DatabaseDescription}; |
765 | |
766 | type Sqlite3UID = i32; |
767 | |
768 | @@ -287,23 +289,45 @@ mod sqlite3_m { |
769 | })?; |
770 | |
771 | if let Some(Ok(highestmodseq)) = select_response.highestmodseq { |
772 | - self.connection.execute( |
773 | - "INSERT OR IGNORE INTO mailbox (uidvalidity, flags, highestmodseq, mailbox_hash) VALUES (?1, ?2, ?3, ?4)", |
774 | - sqlite3::params![select_response.uidvalidity as Sqlite3UID, select_response.flags.1.iter().map(|s| s.as_str()).collect::<Vec<&str>>().join("\0").as_bytes(), highestmodseq, mailbox_hash], |
775 | - ) |
776 | - .chain_err_summary(|| { |
777 | - format!( |
778 | - "Could not insert uidvalidity {} in header_cache of account {}", |
779 | - select_response.uidvalidity, self.uid_store.account_name |
780 | - ) |
781 | - })?; |
782 | + self.connection |
783 | + .execute( |
784 | + "INSERT OR IGNORE INTO mailbox (uidvalidity, flags, highestmodseq, \ |
785 | + mailbox_hash) VALUES (?1, ?2, ?3, ?4)", |
786 | + sqlite3::params![ |
787 | + select_response.uidvalidity as Sqlite3UID, |
788 | + select_response |
789 | + .flags |
790 | + .1 |
791 | + .iter() |
792 | + .map(|s| s.as_str()) |
793 | + .collect::<Vec<&str>>() |
794 | + .join("\0") |
795 | + .as_bytes(), |
796 | + highestmodseq, |
797 | + mailbox_hash |
798 | + ], |
799 | + ) |
800 | + .chain_err_summary(|| { |
801 | + format!( |
802 | + "Could not insert uidvalidity {} in header_cache of account {}", |
803 | + select_response.uidvalidity, self.uid_store.account_name |
804 | + ) |
805 | + })?; |
806 | } else { |
807 | self.connection |
808 | .execute( |
809 | - "INSERT OR IGNORE INTO mailbox (uidvalidity, flags, mailbox_hash) VALUES (?1, ?2, ?3)", |
810 | + "INSERT OR IGNORE INTO mailbox (uidvalidity, flags, mailbox_hash) VALUES \ |
811 | + (?1, ?2, ?3)", |
812 | sqlite3::params![ |
813 | select_response.uidvalidity as Sqlite3UID, |
814 | - select_response.flags.1.iter().map(|s| s.as_str()).collect::<Vec<&str>>().join("\0").as_bytes(), |
815 | + select_response |
816 | + .flags |
817 | + .1 |
818 | + .iter() |
819 | + .map(|s| s.as_str()) |
820 | + .collect::<Vec<&str>>() |
821 | + .join("\0") |
822 | + .as_bytes(), |
823 | mailbox_hash |
824 | ], |
825 | ) |
826 | @@ -463,9 +487,24 @@ mod sqlite3_m { |
827 | { |
828 | max_uid = std::cmp::max(max_uid, *uid); |
829 | tx.execute( |
830 | - "INSERT OR REPLACE INTO envelopes (hash, uid, mailbox_hash, modsequence, envelope) VALUES (?1, ?2, ?3, ?4, ?5)", |
831 | - sqlite3::params![envelope.hash(), *uid as Sqlite3UID, mailbox_hash, modseq, &envelope], |
832 | - ).chain_err_summary(|| format!("Could not insert envelope {} {} in header_cache of account {}", envelope.message_id(), envelope.hash(), uid_store.account_name))?; |
833 | + "INSERT OR REPLACE INTO envelopes (hash, uid, mailbox_hash, modsequence, \ |
834 | + envelope) VALUES (?1, ?2, ?3, ?4, ?5)", |
835 | + sqlite3::params![ |
836 | + envelope.hash(), |
837 | + *uid as Sqlite3UID, |
838 | + mailbox_hash, |
839 | + modseq, |
840 | + &envelope |
841 | + ], |
842 | + ) |
843 | + .chain_err_summary(|| { |
844 | + format!( |
845 | + "Could not insert envelope {} {} in header_cache of account {}", |
846 | + envelope.message_id(), |
847 | + envelope.hash(), |
848 | + uid_store.account_name |
849 | + ) |
850 | + })?; |
851 | } |
852 | } |
853 | tx.commit()?; |
854 | @@ -523,15 +562,17 @@ mod sqlite3_m { |
855 | env.tags_mut() |
856 | .extend(tags.iter().map(|t| TagHash::from_bytes(t.as_bytes()))); |
857 | tx.execute( |
858 | - "UPDATE envelopes SET envelope = ?1 WHERE mailbox_hash = ?2 AND uid = ?3;", |
859 | - sqlite3::params![&env, mailbox_hash, *uid as Sqlite3UID], |
860 | - ) |
861 | - .chain_err_summary(|| { |
862 | - format!( |
863 | - "Could not update envelope {} uid {} from mailbox {} account {}", |
864 | - env_hash, *uid, mailbox_hash, uid_store.account_name |
865 | - ) |
866 | - })?; |
867 | + "UPDATE envelopes SET envelope = ?1 WHERE mailbox_hash = ?2 AND \ |
868 | + uid = ?3;", |
869 | + sqlite3::params![&env, mailbox_hash, *uid as Sqlite3UID], |
870 | + ) |
871 | + .chain_err_summary(|| { |
872 | + format!( |
873 | + "Could not update envelope {} uid {} from mailbox {} account \ |
874 | + {}", |
875 | + env_hash, *uid, mailbox_hash, uid_store.account_name |
876 | + ) |
877 | + })?; |
878 | uid_store |
879 | .envelopes |
880 | .lock() |
881 | @@ -563,8 +604,9 @@ mod sqlite3_m { |
882 | let mut ret: Vec<(UID, Envelope, Option<ModSequence>)> = match identifier { |
883 | Ok(uid) => { |
884 | let mut stmt = self.connection.prepare( |
885 | - "SELECT uid, envelope, modsequence FROM envelopes WHERE mailbox_hash = ?1 AND uid = ?2;", |
886 | - )?; |
887 | + "SELECT uid, envelope, modsequence FROM envelopes WHERE mailbox_hash = ?1 \ |
888 | + AND uid = ?2;", |
889 | + )?; |
890 | |
891 | let x = stmt |
892 | .query_map(sqlite3::params![mailbox_hash, uid as Sqlite3UID], |row| { |
893 | @@ -579,8 +621,9 @@ mod sqlite3_m { |
894 | } |
895 | Err(env_hash) => { |
896 | let mut stmt = self.connection.prepare( |
897 | - "SELECT uid, envelope, modsequence FROM envelopes WHERE mailbox_hash = ?1 AND hash = ?2;", |
898 | - )?; |
899 | + "SELECT uid, envelope, modsequence FROM envelopes WHERE mailbox_hash = ?1 \ |
900 | + AND hash = ?2;", |
901 | + )?; |
902 | |
903 | let x = stmt |
904 | .query_map(sqlite3::params![mailbox_hash, env_hash], |row| { |
905 | diff --git a/melib/src/backends/imap/cache/sync.rs b/melib/src/backends/imap/cache/sync.rs |
906 | index 2497d4e..3dde2cc 100644 |
907 | --- a/melib/src/backends/imap/cache/sync.rs |
908 | +++ b/melib/src/backends/imap/cache/sync.rs |
909 | @@ -130,7 +130,8 @@ impl ImapConnection { |
910 | // 2. tag1 UID FETCH <lastseenuid+1>:* <descriptors> |
911 | self.send_command( |
912 | format!( |
913 | - "UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)", |
914 | + "UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \ |
915 | + BODYSTRUCTURE)", |
916 | max_uid + 1 |
917 | ) |
918 | .as_bytes(), |
919 | @@ -375,9 +376,9 @@ impl ImapConnection { |
920 | // client MUST |
921 | // * empty the local cache of that mailbox; |
922 | // * "forget" the cached HIGHESTMODSEQ value for the mailbox; |
923 | - // * remove any pending "actions" that refer to UIDs in that |
924 | - // mailbox (note that this doesn't affect actions performed on |
925 | - // client-generated fake UIDs; see Section 5); and |
926 | + // * remove any pending "actions" that refer to UIDs in that mailbox (note |
927 | + // that this doesn't affect actions performed on client-generated fake UIDs; |
928 | + // see Section 5); and |
929 | // * skip steps 1b and 2-II; |
930 | cache_handle.clear(mailbox_hash, &select_response)?; |
931 | return Ok(None); |
932 | @@ -398,9 +399,9 @@ impl ImapConnection { |
933 | let new_highestmodseq = select_response.highestmodseq.unwrap().unwrap(); |
934 | let mut refresh_events = vec![]; |
935 | // 1b) Check the mailbox HIGHESTMODSEQ. |
936 | - // If the cached value is the same as the one returned by the server, skip fetching |
937 | - // message flags on step 2-II, i.e., the client only has to find out which messages got |
938 | - // expunged. |
939 | + // If the cached value is the same as the one returned by the server, skip |
940 | + // fetching message flags on step 2-II, i.e., the client only has to |
941 | + // find out which messages got expunged. |
942 | if cached_highestmodseq != new_highestmodseq { |
943 | /* Cache is synced, only figure out which messages got expunged */ |
944 | |
945 | @@ -415,7 +416,8 @@ impl ImapConnection { |
946 | // 2. tag1 UID FETCH <lastseenuid+1>:* <descriptors> |
947 | self.send_command( |
948 | format!( |
949 | - "UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE) (CHANGEDSINCE {})", |
950 | + "UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \ |
951 | + BODYSTRUCTURE) (CHANGEDSINCE {})", |
952 | cached_max_uid + 1, |
953 | cached_highestmodseq, |
954 | ) |
955 | @@ -571,8 +573,8 @@ impl ImapConnection { |
956 | .insert(mailbox_hash, Ok(new_highestmodseq)); |
957 | } |
958 | let mut valid_envs = BTreeSet::default(); |
959 | - // This should be UID SEARCH 1:<maxuid> but it's difficult to compare to cached UIDs at the |
960 | - // point of calling this function |
961 | + // This should be UID SEARCH 1:<maxuid> but it's difficult to compare to cached |
962 | + // UIDs at the point of calling this function |
963 | self.send_command(b"UID SEARCH ALL").await?; |
964 | self.read_response(&mut response, RequiredResponses::SEARCH) |
965 | .await?; |
966 | @@ -614,7 +616,8 @@ impl ImapConnection { |
967 | Ok(Some(payload.into_iter().map(|(_, env)| env).collect())) |
968 | } |
969 | |
970 | - //rfc7162_Quick Flag Changes Resynchronization (CONDSTORE)_and Quick Mailbox Resynchronization (QRESYNC) |
971 | + //rfc7162_Quick Flag Changes Resynchronization (CONDSTORE)_and Quick Mailbox |
972 | + // Resynchronization (QRESYNC) |
973 | pub async fn resync_condstoreqresync( |
974 | &mut self, |
975 | _cache_handle: Box<dyn ImapCache>, |
976 | @@ -634,8 +637,8 @@ impl ImapConnection { |
977 | ) |
978 | }; |
979 | |
980 | - /* first SELECT the mailbox to get READ/WRITE permissions (because EXAMINE only |
981 | - * returns READ-ONLY for both cases) */ |
982 | + /* first SELECT the mailbox to get READ/WRITE permissions (because EXAMINE |
983 | + * only returns READ-ONLY for both cases) */ |
984 | let mut select_response = self |
985 | .select_mailbox(mailbox_hash, &mut response, true) |
986 | .await? |
987 | diff --git a/melib/src/backends/imap/connection.rs b/melib/src/backends/imap/connection.rs |
988 | index 8918117..1b9c76c 100644 |
989 | --- a/melib/src/backends/imap/connection.rs |
990 | +++ b/melib/src/backends/imap/connection.rs |
991 | @@ -20,33 +20,38 @@ |
992 | */ |
993 | |
994 | use super::protocol_parser::{ImapLineSplit, ImapResponse, RequiredResponses, SelectResponse}; |
995 | - use crate::backends::{MailboxHash, RefreshEvent}; |
996 | - use crate::connections::{lookup_ipv4, timeout, Connection}; |
997 | - use crate::email::parser::BytesExt; |
998 | - use crate::error::*; |
999 | + use crate::{ |
1000 | + backends::{MailboxHash, RefreshEvent}, |
1001 | + connections::{lookup_ipv4, timeout, Connection}, |
1002 | + email::parser::BytesExt, |
1003 | + error::*, |
1004 | + }; |
1005 | extern crate native_tls; |
1006 | + use std::{ |
1007 | + collections::HashSet, |
1008 | + convert::TryFrom, |
1009 | + future::Future, |
1010 | + iter::FromIterator, |
1011 | + pin::Pin, |
1012 | + sync::Arc, |
1013 | + time::{Duration, Instant, SystemTime}, |
1014 | + }; |
1015 | + |
1016 | use futures::io::{AsyncReadExt, AsyncWriteExt}; |
1017 | use native_tls::TlsConnector; |
1018 | pub use smol::Async as AsyncWrapper; |
1019 | - use std::collections::HashSet; |
1020 | - use std::convert::TryFrom; |
1021 | - use std::future::Future; |
1022 | - use std::iter::FromIterator; |
1023 | - use std::pin::Pin; |
1024 | - use std::sync::Arc; |
1025 | - use std::time::{Duration, Instant, SystemTime}; |
1026 | |
1027 | const IMAP_PROTOCOL_TIMEOUT: Duration = Duration::from_secs(60 * 28); |
1028 | |
1029 | - use super::protocol_parser; |
1030 | - use super::{Capabilities, ImapServerConf, UIDStore}; |
1031 | + use super::{protocol_parser, Capabilities, ImapServerConf, UIDStore}; |
1032 | |
1033 | #[derive(Debug, Clone, Copy)] |
1034 | pub enum SyncPolicy { |
1035 | None, |
1036 | ///rfc4549 `Synch Ops for Disconnected IMAP4 Clients` <https://tools.ietf.org/html/rfc4549> |
1037 | Basic, |
1038 | - ///rfc7162 `IMAP Extensions: Quick Flag Changes Resynchronization (CONDSTORE) and Quick Mailbox Resynchronization (QRESYNC)` |
1039 | + ///rfc7162 `IMAP Extensions: Quick Flag Changes Resynchronization |
1040 | + /// (CONDSTORE) and Quick Mailbox Resynchronization (QRESYNC)` |
1041 | Condstore, |
1042 | CondstoreQresync, |
1043 | } |
1044 | @@ -144,13 +149,14 @@ impl ImapStream { |
1045 | if let Some(timeout) = server_conf.timeout { |
1046 | TcpStream::connect_timeout(&addr, timeout)? |
1047 | } else { |
1048 | - TcpStream::connect(&addr)? |
1049 | + TcpStream::connect(addr)? |
1050 | }, |
1051 | ))?; |
1052 | if server_conf.use_starttls { |
1053 | let err_fn = || { |
1054 | if server_conf.server_port == 993 { |
1055 | - "STARTTLS failed. Server port is set to 993, which normally uses TLS. Maybe try disabling use_starttls." |
1056 | + "STARTTLS failed. Server port is set to 993, which normally uses TLS. \ |
1057 | + Maybe try disabling use_starttls." |
1058 | } else { |
1059 | "STARTTLS failed. Is the connection already encrypted?" |
1060 | } |
1061 | @@ -246,7 +252,7 @@ impl ImapStream { |
1062 | if let Some(timeout) = server_conf.timeout { |
1063 | TcpStream::connect_timeout(&addr, timeout)? |
1064 | } else { |
1065 | - TcpStream::connect(&addr)? |
1066 | + TcpStream::connect(addr)? |
1067 | }, |
1068 | ))? |
1069 | }; |
1070 | @@ -350,10 +356,14 @@ impl ImapStream { |
1071 | .any(|cap| cap.eq_ignore_ascii_case(b"AUTH=XOAUTH2")) |
1072 | { |
1073 | return Err(Error::new(format!( |
1074 | - "Could not connect to {}: OAUTH2 is enabled but server did not return AUTH=XOAUTH2 capability. Returned capabilities were: {}", |
1075 | - &server_conf.server_hostname, |
1076 | - capabilities.iter().map(|capability| |
1077 | - String::from_utf8_lossy(capability).to_string()).collect::<Vec<String>>().join(" ") |
1078 | + "Could not connect to {}: OAUTH2 is enabled but server did not return \ |
1079 | + AUTH=XOAUTH2 capability. Returned capabilities were: {}", |
1080 | + &server_conf.server_hostname, |
1081 | + capabilities |
1082 | + .iter() |
1083 | + .map(|capability| String::from_utf8_lossy(capability).to_string()) |
1084 | + .collect::<Vec<String>>() |
1085 | + .join(" ") |
1086 | ))); |
1087 | } |
1088 | ret.send_command( |
1089 | @@ -414,8 +424,8 @@ impl ImapStream { |
1090 | } |
1091 | |
1092 | if capabilities.is_none() { |
1093 | - /* sending CAPABILITY after LOGIN automatically is an RFC recommendation, so check |
1094 | - * for lazy servers */ |
1095 | + /* sending CAPABILITY after LOGIN automatically is an RFC recommendation, so |
1096 | + * check for lazy servers */ |
1097 | drop(capabilities); |
1098 | ret.send_command(b"CAPABILITY").await?; |
1099 | ret.read_response(&mut res).await.unwrap(); |
1100 | @@ -648,7 +658,14 @@ impl ImapConnection { |
1101 | | ImapResponse::Bad(code) |
1102 | | ImapResponse::Preauth(code) |
1103 | | ImapResponse::Bye(code) => { |
1104 | - crate::log(format!("Could not use COMPRESS=DEFLATE in account `{}`: server replied with `{}`", self.uid_store.account_name, code), crate::LoggingLevel::WARN); |
1105 | + crate::log( |
1106 | + format!( |
1107 | + "Could not use COMPRESS=DEFLATE in account `{}`: server \ |
1108 | + replied with `{}`", |
1109 | + self.uid_store.account_name, code |
1110 | + ), |
1111 | + crate::LoggingLevel::WARN, |
1112 | + ); |
1113 | } |
1114 | ImapResponse::Ok(_) => { |
1115 | let ImapStream { |
1116 | @@ -750,7 +767,7 @@ impl ImapConnection { |
1117 | &required_responses |
1118 | );*/ |
1119 | for l in response.split_rn() { |
1120 | - /*debug!("check line: {}", &l);*/ |
1121 | + /* debug!("check line: {}", &l); */ |
1122 | if required_responses.check(l) || !self.process_untagged(l).await? { |
1123 | ret.extend_from_slice(l); |
1124 | } |
1125 | diff --git a/melib/src/backends/imap/mailbox.rs b/melib/src/backends/imap/mailbox.rs |
1126 | index 0e8aa7f..a26d3da 100644 |
1127 | --- a/melib/src/backends/imap/mailbox.rs |
1128 | +++ b/melib/src/backends/imap/mailbox.rs |
1129 | @@ -19,12 +19,15 @@ |
1130 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1131 | */ |
1132 | |
1133 | + use std::sync::{Arc, Mutex, RwLock}; |
1134 | + |
1135 | use super::protocol_parser::SelectResponse; |
1136 | - use crate::backends::{ |
1137 | - BackendMailbox, LazyCountSet, Mailbox, MailboxHash, MailboxPermissions, SpecialUsageMailbox, |
1138 | + use crate::{ |
1139 | + backends::{ |
1140 | + BackendMailbox, LazyCountSet, Mailbox, MailboxHash, MailboxPermissions, SpecialUsageMailbox, |
1141 | + }, |
1142 | + error::*, |
1143 | }; |
1144 | - use crate::error::*; |
1145 | - use std::sync::{Arc, Mutex, RwLock}; |
1146 | |
1147 | #[derive(Debug, Default, Clone)] |
1148 | pub struct ImapMailbox { |
1149 | @@ -51,7 +54,8 @@ impl ImapMailbox { |
1150 | &self.imap_path |
1151 | } |
1152 | |
1153 | - /// Establish that mailbox contents have been fetched at least once during this execution |
1154 | + /// Establish that mailbox contents have been fetched at least once during |
1155 | + /// this execution |
1156 | #[inline(always)] |
1157 | pub fn set_warm(&self, new_value: bool) { |
1158 | *self.warm.lock().unwrap() = new_value; |
1159 | diff --git a/melib/src/backends/imap/managesieve.rs b/melib/src/backends/imap/managesieve.rs |
1160 | index e8620d0..6493259 100644 |
1161 | --- a/melib/src/backends/imap/managesieve.rs |
1162 | +++ b/melib/src/backends/imap/managesieve.rs |
1163 | @@ -19,19 +19,25 @@ |
1164 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1165 | */ |
1166 | |
1167 | - use super::{ImapConnection, ImapProtocol, ImapServerConf, UIDStore}; |
1168 | - use crate::conf::AccountSettings; |
1169 | - use crate::email::parser::IResult; |
1170 | - use crate::error::{Error, Result}; |
1171 | - use crate::get_conf_val; |
1172 | - use crate::imap::RequiredResponses; |
1173 | + use std::{ |
1174 | + str::FromStr, |
1175 | + sync::{Arc, Mutex}, |
1176 | + time::SystemTime, |
1177 | + }; |
1178 | + |
1179 | use nom::{ |
1180 | branch::alt, bytes::complete::tag, combinator::map, multi::separated_list1, |
1181 | sequence::separated_pair, |
1182 | }; |
1183 | - use std::str::FromStr; |
1184 | - use std::sync::{Arc, Mutex}; |
1185 | - use std::time::SystemTime; |
1186 | + |
1187 | + use super::{ImapConnection, ImapProtocol, ImapServerConf, UIDStore}; |
1188 | + use crate::{ |
1189 | + conf::AccountSettings, |
1190 | + email::parser::IResult, |
1191 | + error::{Error, Result}, |
1192 | + get_conf_val, |
1193 | + imap::RequiredResponses, |
1194 | + }; |
1195 | |
1196 | pub struct ManageSieveConnection { |
1197 | pub inner: ImapConnection, |
1198 | @@ -61,12 +67,17 @@ pub enum ManageSieveResponse<'a> { |
1199 | } |
1200 | |
1201 | mod parser { |
1202 | + use nom::{ |
1203 | + bytes::complete::tag, |
1204 | + character::complete::crlf, |
1205 | + combinator::{iterator, map, opt}, |
1206 | + }; |
1207 | + pub use nom::{ |
1208 | + bytes::complete::{is_not, tag_no_case}, |
1209 | + sequence::{delimited, pair, preceded, terminated}, |
1210 | + }; |
1211 | + |
1212 | use super::*; |
1213 | - use nom::bytes::complete::tag; |
1214 | - pub use nom::bytes::complete::{is_not, tag_no_case}; |
1215 | - use nom::character::complete::crlf; |
1216 | - use nom::combinator::{iterator, map, opt}; |
1217 | - pub use nom::sequence::{delimited, pair, preceded, terminated}; |
1218 | |
1219 | pub fn sieve_name(input: &[u8]) -> IResult<&[u8], &[u8]> { |
1220 | crate::backends::imap::protocol_parser::string_token(input) |
1221 | diff --git a/melib/src/backends/imap/operations.rs b/melib/src/backends/imap/operations.rs |
1222 | index f7b48e3..e2488de 100644 |
1223 | --- a/melib/src/backends/imap/operations.rs |
1224 | +++ b/melib/src/backends/imap/operations.rs |
1225 | @@ -19,13 +19,11 @@ |
1226 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1227 | */ |
1228 | |
1229 | - use super::*; |
1230 | - |
1231 | - use crate::backends::*; |
1232 | - use crate::email::*; |
1233 | - use crate::error::Error; |
1234 | use std::sync::Arc; |
1235 | |
1236 | + use super::*; |
1237 | + use crate::{backends::*, email::*, error::Error}; |
1238 | + |
1239 | /// `BackendOp` implementor for Imap |
1240 | #[derive(Debug, Clone)] |
1241 | pub struct ImapOp { |
1242 | diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs |
1243 | index edcfe98..6fb8238 100644 |
1244 | --- a/melib/src/backends/imap/protocol_parser.rs |
1245 | +++ b/melib/src/backends/imap/protocol_parser.rs |
1246 | @@ -19,24 +19,28 @@ |
1247 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1248 | */ |
1249 | |
1250 | - use super::*; |
1251 | - use crate::email::address::{Address, MailboxAddress}; |
1252 | - use crate::email::parser::{ |
1253 | - generic::{byte_in_range, byte_in_slice}, |
1254 | - BytesExt, IResult, |
1255 | - }; |
1256 | - use crate::error::ResultIntoError; |
1257 | + use std::{convert::TryFrom, str::FromStr}; |
1258 | + |
1259 | use nom::{ |
1260 | branch::{alt, permutation}, |
1261 | bytes::complete::{is_a, is_not, tag, take, take_until, take_while}, |
1262 | - character::complete::digit1, |
1263 | - character::is_digit, |
1264 | + character::{complete::digit1, is_digit}, |
1265 | combinator::{map, map_res, opt}, |
1266 | multi::{fold_many1, length_data, many0, many1, separated_list1}, |
1267 | sequence::{delimited, preceded}, |
1268 | }; |
1269 | - use std::convert::TryFrom; |
1270 | - use std::str::FromStr; |
1271 | + |
1272 | + use super::*; |
1273 | + use crate::{ |
1274 | + email::{ |
1275 | + address::{Address, MailboxAddress}, |
1276 | + parser::{ |
1277 | + generic::{byte_in_range, byte_in_slice}, |
1278 | + BytesExt, IResult, |
1279 | + }, |
1280 | + }, |
1281 | + error::ResultIntoError, |
1282 | + }; |
1283 | |
1284 | bitflags! { |
1285 | #[derive(Default, Serialize, Deserialize)] |
1286 | @@ -137,7 +141,7 @@ fn test_imap_required_responses() { |
1287 | let response = |
1288 | &b"* 1040 FETCH (UID 1064 FLAGS ())\r\nM15 OK Fetch completed (0.001 + 0.299 secs).\r\n"[..]; |
1289 | for l in response.split_rn() { |
1290 | - /*debug!("check line: {}", &l);*/ |
1291 | + /* debug!("check line: {}", &l); */ |
1292 | if required_responses.check(l) { |
1293 | ret.extend_from_slice(l); |
1294 | } |
1295 | @@ -159,35 +163,59 @@ pub struct ImapLineIterator<'a> { |
1296 | |
1297 | #[derive(Debug, PartialEq)] |
1298 | pub enum ResponseCode { |
1299 | - ///The human-readable text contains a special alert that MUST be presented to the user in a fashion that calls the user's attention to the message. |
1300 | + ///The human-readable text contains a special alert that MUST be presented |
1301 | + /// to the user in a fashion that calls the user's attention to the message. |
1302 | Alert(String), |
1303 | |
1304 | - ///Optionally followed by a parenthesized list of charsets. A SEARCH failed because the given charset is not supported by this implementation. If the optional list of charsets is given, this lists the charsets that are supported by this implementation. |
1305 | + ///Optionally followed by a parenthesized list of charsets. A SEARCH |
1306 | + /// failed because the given charset is not supported by this |
1307 | + /// implementation. If the optional list of charsets is given, this lists |
1308 | + /// the charsets that are supported by this implementation. |
1309 | Badcharset(Option<String>), |
1310 | |
1311 | - /// Followed by a list of capabilities. This can appear in the initial OK or PREAUTH response to transmit an initial capabilities list. This makes it unnecessary for a client to send a separate CAPABILITY command if it recognizes this response. |
1312 | + /// Followed by a list of capabilities. This can appear in the initial OK |
1313 | + /// or PREAUTH response to transmit an initial capabilities list. This |
1314 | + /// makes it unnecessary for a client to send a separate CAPABILITY command |
1315 | + /// if it recognizes this response. |
1316 | Capability, |
1317 | |
1318 | - /// The human-readable text represents an error in parsing the [RFC-2822] header or [MIME-IMB] headers of a message in the mailbox. |
1319 | + /// The human-readable text represents an error in parsing the [RFC-2822] |
1320 | + /// header or [MIME-IMB] headers of a message in the mailbox. |
1321 | Parse(String), |
1322 | |
1323 | - /// Followed by a parenthesized list of flags, indicates which of the known flags the client can change permanently. Any flags that are in the FLAGS untagged response, but not the PERMANENTFLAGS list, can not be set permanently. If the client attempts to STORE a flag that is not in the PERMANENTFLAGS list, the server will either ignore the change or store the state change for the remainder of the current session only. The PERMANENTFLAGS list can also include the special flag \*, which indicates that it is possible to create new keywords by attempting to store those flags in the mailbox. |
1324 | + /// Followed by a parenthesized list of flags, indicates which of the known |
1325 | + /// flags the client can change permanently. Any flags that are in the |
1326 | + /// FLAGS untagged response, but not the PERMANENTFLAGS list, can not be set |
1327 | + /// permanently. If the client attempts to STORE a flag that is not in the |
1328 | + /// PERMANENTFLAGS list, the server will either ignore the change or store |
1329 | + /// the state change for the remainder of the current session only. The |
1330 | + /// PERMANENTFLAGS list can also include the special flag \*, which |
1331 | + /// indicates that it is possible to create new keywords by attempting to |
1332 | + /// store those flags in the mailbox. |
1333 | Permanentflags(String), |
1334 | |
1335 | - /// The mailbox is selected read-only, or its access while selected has changed from read-write to read-only. |
1336 | + /// The mailbox is selected read-only, or its access while selected has |
1337 | + /// changed from read-write to read-only. |
1338 | ReadOnly, |
1339 | |
1340 | - /// The mailbox is selected read-write, or its access while selected has changed from read-only to read-write. |
1341 | + /// The mailbox is selected read-write, or its access while selected has |
1342 | + /// changed from read-only to read-write. |
1343 | ReadWrite, |
1344 | |
1345 | - /// An APPEND or COPY attempt is failing because the target mailbox does not exist (as opposed to some other reason). This is a hint to the client that the operation can succeed if the mailbox is first created by the CREATE command. |
1346 | + /// An APPEND or COPY attempt is failing because the target mailbox does not |
1347 | + /// exist (as opposed to some other reason). This is a hint to the client |
1348 | + /// that the operation can succeed if the mailbox is first created by the |
1349 | + /// CREATE command. |
1350 | Trycreate, |
1351 | |
1352 | - /// Followed by a decimal number, indicates the next unique identifier value. Refer to section 2.3.1.1 for more information. |
1353 | + /// Followed by a decimal number, indicates the next unique identifier |
1354 | + /// value. Refer to section 2.3.1.1 for more information. |
1355 | Uidnext(UID), |
1356 | - /// Followed by a decimal number, indicates the unique identifier validity value. Refer to section 2.3.1.1 for more information. |
1357 | + /// Followed by a decimal number, indicates the unique identifier validity |
1358 | + /// value. Refer to section 2.3.1.1 for more information. |
1359 | Uidvalidity(UID), |
1360 | - /// Followed by a decimal number, indicates the number of the first message without the \Seen flag set. |
1361 | + /// Followed by a decimal number, indicates the number of the first message |
1362 | + /// without the \Seen flag set. |
1363 | Unseen(ImapNum), |
1364 | } |
1365 | |
1366 | @@ -195,15 +223,23 @@ impl std::fmt::Display for ResponseCode { |
1367 | fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { |
1368 | use ResponseCode::*; |
1369 | match self { |
1370 | - Alert(s)=> write!(fmt, "ALERT: {}", s), |
1371 | - Badcharset(None)=> write!(fmt, "Given charset is not supported by this server."), |
1372 | - Badcharset(Some(s))=> write!(fmt, "Given charset is not supported by this server. Supported ones are: {}", s), |
1373 | + Alert(s) => write!(fmt, "ALERT: {}", s), |
1374 | + Badcharset(None) => write!(fmt, "Given charset is not supported by this server."), |
1375 | + Badcharset(Some(s)) => write!( |
1376 | + fmt, |
1377 | + "Given charset is not supported by this server. Supported ones are: {}", |
1378 | + s |
1379 | + ), |
1380 | Capability => write!(fmt, "Capability response"), |
1381 | Parse(s) => write!(fmt, "Server error in parsing message headers: {}", s), |
1382 | Permanentflags(s) => write!(fmt, "Mailbox supports these flags: {}", s), |
1383 | - ReadOnly=> write!(fmt, "This mailbox is selected read-only."), |
1384 | + ReadOnly => write!(fmt, "This mailbox is selected read-only."), |
1385 | ReadWrite => write!(fmt, "This mailbox is selected with read-write permissions."), |
1386 | - Trycreate => write!(fmt, "Failed to operate on the target mailbox because it doesn't exist. Try creating it first."), |
1387 | + Trycreate => write!( |
1388 | + fmt, |
1389 | + "Failed to operate on the target mailbox because it doesn't exist. Try creating \ |
1390 | + it first." |
1391 | + ), |
1392 | Uidnext(uid) => write!(fmt, "Next UID value is {}", uid), |
1393 | Uidvalidity(uid) => write!(fmt, "Next UIDVALIDITY value is {}", uid), |
1394 | Unseen(uid) => write!(fmt, "First message without the \\Seen flag is {}", uid), |
1395 | @@ -265,7 +301,8 @@ impl TryFrom<&'_ [u8]> for ImapResponse { |
1396 | )) |
1397 | })? + 1..] |
1398 | .trim(); |
1399 | - // M12 NO [CANNOT] Invalid mailbox name: Name must not have \'/\' characters (0.000 + 0.098 + 0.097 secs).\r\n |
1400 | + // M12 NO [CANNOT] Invalid mailbox name: Name must not have \'/\' characters |
1401 | + // (0.000 + 0.098 + 0.097 secs).\r\n |
1402 | if val.ends_with(b" secs).") { |
1403 | val = &val[..val.rfind(b"(").ok_or_else(|| { |
1404 | Error::new(format!( |
1405 | @@ -432,8 +469,8 @@ fn test_imap_line_iterator() { |
1406 | */ |
1407 | |
1408 | /* |
1409 | - * LIST (\HasNoChildren) "." INBOX.Sent |
1410 | - * LIST (\HasChildren) "." INBOX |
1411 | + * LIST (\HasNoChildren) "." INBOX.Sent |
1412 | + * LIST (\HasChildren) "." INBOX |
1413 | */ |
1414 | |
1415 | pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> { |
1416 | @@ -604,7 +641,8 @@ pub fn fetch_response(input: &[u8]) -> ImapParseResult<FetchResponse<'_>> { |
1417 | i += (input.len() - i - rest.len()) + 1; |
1418 | } else { |
1419 | return debug!(Err(Error::new(format!( |
1420 | - "Unexpected input while parsing UID FETCH response. Could not parse FLAGS: {:.40}.", |
1421 | + "Unexpected input while parsing UID FETCH response. Could not parse FLAGS: \ |
1422 | + {:.40}.", |
1423 | String::from_utf8_lossy(&input[i..]) |
1424 | )))); |
1425 | } |
1426 | @@ -639,7 +677,8 @@ pub fn fetch_response(input: &[u8]) -> ImapParseResult<FetchResponse<'_>> { |
1427 | i += input.len() - i - rest.len(); |
1428 | } else { |
1429 | return debug!(Err(Error::new(format!( |
1430 | - "Unexpected input while parsing UID FETCH response. Could not parse RFC822: {:.40}", |
1431 | + "Unexpected input while parsing UID FETCH response. Could not parse RFC822: \ |
1432 | + {:.40}", |
1433 | String::from_utf8_lossy(&input[i..]) |
1434 | )))); |
1435 | } |
1436 | @@ -650,7 +689,8 @@ pub fn fetch_response(input: &[u8]) -> ImapParseResult<FetchResponse<'_>> { |
1437 | i += input.len() - i - rest.len(); |
1438 | } else { |
1439 | return debug!(Err(Error::new(format!( |
1440 | - "Unexpected input while parsing UID FETCH response. Could not parse ENVELOPE: {:.40}", |
1441 | + "Unexpected input while parsing UID FETCH response. Could not parse ENVELOPE: \ |
1442 | + {:.40}", |
1443 | String::from_utf8_lossy(&input[i..]) |
1444 | )))); |
1445 | } |
1446 | @@ -672,7 +712,8 @@ pub fn fetch_response(input: &[u8]) -> ImapParseResult<FetchResponse<'_>> { |
1447 | i += input.len() - i - rest.len(); |
1448 | } else { |
1449 | return debug!(Err(Error::new(format!( |
1450 | - "Unexpected input while parsing UID FETCH response. Could not parse BODY[HEADER.FIELDS (REFERENCES)]: {:.40}", |
1451 | + "Unexpected input while parsing UID FETCH response. Could not parse \ |
1452 | + BODY[HEADER.FIELDS (REFERENCES)]: {:.40}", |
1453 | String::from_utf8_lossy(&input[i..]) |
1454 | )))); |
1455 | } |
1456 | @@ -688,7 +729,8 @@ pub fn fetch_response(input: &[u8]) -> ImapParseResult<FetchResponse<'_>> { |
1457 | i += input.len() - i - rest.len(); |
1458 | } else { |
1459 | return debug!(Err(Error::new(format!( |
1460 | - "Unexpected input while parsing UID FETCH response. Could not parse BODY[HEADER.FIELDS (\"REFERENCES\"): {:.40}", |
1461 | + "Unexpected input while parsing UID FETCH response. Could not parse \ |
1462 | + BODY[HEADER.FIELDS (\"REFERENCES\"): {:.40}", |
1463 | String::from_utf8_lossy(&input[i..]) |
1464 | )))); |
1465 | } |
1466 | @@ -815,9 +857,15 @@ macro_rules! flags_to_imap_list { |
1467 | /* Input Example: |
1468 | * ============== |
1469 | * |
1470 | - * "M0 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in\r\n" |
1471 | - * "* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENT TOKEN AUTH=OAUTHBEARER AUTH=XOAUTH\r\n" |
1472 | - * "* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN\r\n" |
1473 | + * "M0 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE |
1474 | + * IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT |
1475 | + * MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS |
1476 | + * LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN |
1477 | + * CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in\r\n" |
1478 | + * "* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN |
1479 | + * X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENT TOKEN |
1480 | + * AUTH=OAUTHBEARER AUTH=XOAUTH\r\n" "* CAPABILITY IMAP4rev1 LITERAL+ |
1481 | + * SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN\r\n" |
1482 | */ |
1483 | |
1484 | pub fn capabilities(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { |
1485 | @@ -829,7 +877,8 @@ pub fn capabilities(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { |
1486 | Ok((input, ret)) |
1487 | } |
1488 | |
1489 | - /// This enum represents the server's untagged responses detailed in `7. Server Responses` of RFC 3501 INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1 |
1490 | + /// This enum represents the server's untagged responses detailed in `7. Server |
1491 | + /// Responses` of RFC 3501 INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1 |
1492 | #[derive(Debug, PartialEq)] |
1493 | pub enum UntaggedResponse<'s> { |
1494 | /// ```text |
1495 | @@ -1090,7 +1139,8 @@ pub struct SelectResponse { |
1496 | /* |
1497 | * |
1498 | * * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) |
1499 | - * * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted. |
1500 | + * * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags |
1501 | + * permitted. |
1502 | * * 45 EXISTS |
1503 | * * 0 RECENT |
1504 | * * OK [UNSEEN 16] First unseen. |
1505 | @@ -1283,30 +1333,30 @@ pub fn byte_flags(input: &[u8]) -> IResult<&[u8], (Flag, Vec<String>)> { |
1506 | } |
1507 | |
1508 | /* |
1509 | - * The fields of the envelope structure are in the following |
1510 | - * order: date, subject, from, sender, reply-to, to, cc, bcc, |
1511 | - * in-reply-to, and message-id. The date, subject, in-reply-to, |
1512 | - * and message-id fields are strings. The from, sender, reply-to, |
1513 | - * to, cc, and bcc fields are parenthesized lists of address |
1514 | - * structures. |
1515 | - * An address structure is a parenthesized list that describes an |
1516 | - * electronic mail address. The fields of an address structure |
1517 | - * are in the following order: personal name, [SMTP] |
1518 | - * at-domain-list (source route), mailbox name, and host name. |
1519 | - */ |
1520 | + * The fields of the envelope structure are in the following |
1521 | + * order: date, subject, from, sender, reply-to, to, cc, bcc, |
1522 | + * in-reply-to, and message-id. The date, subject, in-reply-to, |
1523 | + * and message-id fields are strings. The from, sender, reply-to, |
1524 | + * to, cc, and bcc fields are parenthesized lists of address |
1525 | + * structures. |
1526 | + * An address structure is a parenthesized list that describes an |
1527 | + * electronic mail address. The fields of an address structure |
1528 | + * are in the following order: personal name, [SMTP] |
1529 | + * at-domain-list (source route), mailbox name, and host name. |
1530 | + */ |
1531 | |
1532 | /* |
1533 | - * * 12 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul-1996 02:44:25 -0700" |
1534 | - * RFC822.SIZE 4286 ENVELOPE ("Wed, 17 Jul 1996 02:23:25 -0700 (PDT)" |
1535 | - * "IMAP4rev1 WG mtg summary and minutes" |
1536 | - * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1537 | - * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1538 | - * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1539 | - * ((NIL NIL "imap" "cac.washington.edu")) |
1540 | - * ((NIL NIL "minutes" "CNRI.Reston.VA.US") |
1541 | - * ("John Klensin" NIL "KLENSIN" "MIT.EDU")) NIL NIL |
1542 | - * "<B27397-0100000@cac.washington.edu>") |
1543 | - */ |
1544 | + * * 12 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul-1996 02:44:25 -0700" |
1545 | + * RFC822.SIZE 4286 ENVELOPE ("Wed, 17 Jul 1996 02:23:25 -0700 (PDT)" |
1546 | + * "IMAP4rev1 WG mtg summary and minutes" |
1547 | + * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1548 | + * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1549 | + * (("Terry Gray" NIL "gray" "cac.washington.edu")) |
1550 | + * ((NIL NIL "imap" "cac.washington.edu")) |
1551 | + * ((NIL NIL "minutes" "CNRI.Reston.VA.US") |
1552 | + * ("John Klensin" NIL "KLENSIN" "MIT.EDU")) NIL NIL |
1553 | + * "<B27397-0100000@cac.washington.edu>") |
1554 | + */ |
1555 | |
1556 | pub fn envelope(input: &[u8]) -> IResult<&[u8], Envelope> { |
1557 | let (input, _) = tag("(")(input)?; |
1558 | @@ -1466,7 +1516,8 @@ pub fn envelope_address(input: &[u8]) -> IResult<&[u8], Address> { |
1559 | )) |
1560 | } |
1561 | |
1562 | - // Read a literal ie a byte sequence prefixed with a tag containing its length delimited in {}s |
1563 | + // Read a literal ie a byte sequence prefixed with a tag containing its length |
1564 | + // delimited in {}s |
1565 | pub fn literal(input: &[u8]) -> IResult<&[u8], &[u8]> { |
1566 | length_data(delimited( |
1567 | tag("{"), |
1568 | @@ -1694,7 +1745,8 @@ pub fn string_token(input: &[u8]) -> IResult<&[u8], &[u8]> { |
1569 | // ASTRING-CHAR = ATOM-CHAR / resp-specials |
1570 | // atom = 1*ATOM-CHAR |
1571 | // ATOM-CHAR = <any CHAR except atom-specials> |
1572 | - // atom-specials = "(" / ")" / "{" / SP / CTL / list-wildcards / quoted-specials / resp-specials |
1573 | + // atom-specials = "(" / ")" / "{" / SP / CTL / list-wildcards / quoted-specials |
1574 | + // / resp-specials |
1575 | fn astring_char(input: &[u8]) -> IResult<&[u8], &[u8]> { |
1576 | let (rest, chars) = many1(atom_char)(input)?; |
1577 | Ok((rest, &input[0..chars.len()])) |
1578 | diff --git a/melib/src/backends/imap/untagged.rs b/melib/src/backends/imap/untagged.rs |
1579 | index 5f80beb..89b4df5 100644 |
1580 | --- a/melib/src/backends/imap/untagged.rs |
1581 | +++ b/melib/src/backends/imap/untagged.rs |
1582 | @@ -19,18 +19,21 @@ |
1583 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1584 | */ |
1585 | |
1586 | + use std::convert::TryInto; |
1587 | + |
1588 | use super::{ImapConnection, MailboxSelection, UID}; |
1589 | - use crate::backends::imap::protocol_parser::{ |
1590 | - generate_envelope_hash, FetchResponse, ImapLineSplit, RequiredResponses, UntaggedResponse, |
1591 | - }; |
1592 | - use crate::backends::BackendMailbox; |
1593 | - use crate::backends::{ |
1594 | - RefreshEvent, |
1595 | - RefreshEventKind::{self, *}, |
1596 | - TagHash, |
1597 | + use crate::{ |
1598 | + backends::{ |
1599 | + imap::protocol_parser::{ |
1600 | + generate_envelope_hash, FetchResponse, ImapLineSplit, RequiredResponses, |
1601 | + UntaggedResponse, |
1602 | + }, |
1603 | + BackendMailbox, RefreshEvent, |
1604 | + RefreshEventKind::{self, *}, |
1605 | + TagHash, |
1606 | + }, |
1607 | + error::*, |
1608 | }; |
1609 | - use crate::error::*; |
1610 | - use std::convert::TryInto; |
1611 | |
1612 | impl ImapConnection { |
1613 | pub async fn process_untagged(&mut self, line: &[u8]) -> Result<bool> { |
1614 | @@ -323,7 +326,11 @@ impl ImapConnection { |
1615 | accum.push(','); |
1616 | accum.push_str(to_str!(ms).trim()); |
1617 | } |
1618 | - format!("UID FETCH {} (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)", accum) |
1619 | + format!( |
1620 | + "UID FETCH {} (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS \ |
1621 | + (REFERENCES)] BODYSTRUCTURE)", |
1622 | + accum |
1623 | + ) |
1624 | }; |
1625 | try_fail!( |
1626 | mailbox_hash, |
1627 | diff --git a/melib/src/backends/imap/watch.rs b/melib/src/backends/imap/watch.rs |
1628 | index 46ae2a2..61f3704 100644 |
1629 | --- a/melib/src/backends/imap/watch.rs |
1630 | +++ b/melib/src/backends/imap/watch.rs |
1631 | @@ -18,9 +18,10 @@ |
1632 | * You should have received a copy of the GNU General Public License |
1633 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1634 | */ |
1635 | + use std::sync::Arc; |
1636 | + |
1637 | use super::*; |
1638 | use crate::backends::SpecialUsageMailbox; |
1639 | - use std::sync::Arc; |
1640 | |
1641 | /// Arguments for IMAP watching functions |
1642 | pub struct ImapWatchKit { |
1643 | @@ -52,8 +53,8 @@ pub async fn poll_with_examine(kit: ImapWatchKit) -> Result<()> { |
1644 | |
1645 | pub async fn idle(kit: ImapWatchKit) -> Result<()> { |
1646 | debug!("IDLE"); |
1647 | - /* IDLE only watches the connection's selected mailbox. We will IDLE on INBOX and every ~5 |
1648 | - * minutes wake up and poll the others */ |
1649 | + /* IDLE only watches the connection's selected mailbox. We will IDLE on INBOX |
1650 | + * and every ~5 minutes wake up and poll the others */ |
1651 | let ImapWatchKit { |
1652 | mut conn, |
1653 | main_conn, |
1654 | @@ -70,7 +71,10 @@ pub async fn idle(kit: ImapWatchKit) -> Result<()> { |
1655 | { |
1656 | Some(mailbox) => mailbox, |
1657 | None => { |
1658 | - return Err(Error::new("INBOX mailbox not found in local mailbox index. meli may have not parsed the IMAP mailboxes correctly")); |
1659 | + return Err(Error::new( |
1660 | + "INBOX mailbox not found in local mailbox index. meli may have not parsed the \ |
1661 | + IMAP mailboxes correctly", |
1662 | + )); |
1663 | } |
1664 | }; |
1665 | let mailbox_hash = mailbox.hash(); |
1666 | @@ -342,7 +346,8 @@ pub async fn examine_updates( |
1667 | } else if select_response.exists > mailbox.exists.lock().unwrap().len() { |
1668 | conn.send_command( |
1669 | format!( |
1670 | - "FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)", |
1671 | + "FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \ |
1672 | + BODYSTRUCTURE)", |
1673 | std::cmp::max(mailbox.exists.lock().unwrap().len(), 1) |
1674 | ) |
1675 | .as_bytes(), |
1676 | diff --git a/melib/src/backends/jmap.rs b/melib/src/backends/jmap.rs |
1677 | index 83427f7..54efcab 100644 |
1678 | --- a/melib/src/backends/jmap.rs |
1679 | +++ b/melib/src/backends/jmap.rs |
1680 | @@ -19,21 +19,26 @@ |
1681 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1682 | */ |
1683 | |
1684 | - use crate::backends::*; |
1685 | - use crate::conf::AccountSettings; |
1686 | - use crate::connections::timeout; |
1687 | - use crate::email::*; |
1688 | - use crate::error::{Error, Result}; |
1689 | - use crate::Collection; |
1690 | + use std::{ |
1691 | + collections::{HashMap, HashSet}, |
1692 | + convert::TryFrom, |
1693 | + str::FromStr, |
1694 | + sync::{Arc, Mutex, RwLock}, |
1695 | + time::{Duration, Instant}, |
1696 | + }; |
1697 | + |
1698 | use futures::lock::Mutex as FutureMutex; |
1699 | - use isahc::config::RedirectPolicy; |
1700 | - use isahc::{AsyncReadResponseExt, HttpClient}; |
1701 | + use isahc::{config::RedirectPolicy, AsyncReadResponseExt, HttpClient}; |
1702 | use serde_json::Value; |
1703 | - use std::collections::{HashMap, HashSet}; |
1704 | - use std::convert::TryFrom; |
1705 | - use std::str::FromStr; |
1706 | - use std::sync::{Arc, Mutex, RwLock}; |
1707 | - use std::time::{Duration, Instant}; |
1708 | + |
1709 | + use crate::{ |
1710 | + backends::*, |
1711 | + conf::AccountSettings, |
1712 | + connections::timeout, |
1713 | + email::*, |
1714 | + error::{Error, Result}, |
1715 | + Collection, |
1716 | + }; |
1717 | |
1718 | #[macro_export] |
1719 | macro_rules! _impl { |
1720 | @@ -131,7 +136,9 @@ impl JmapServerConf { |
1721 | ^ s.extra.contains_key("server_password")) |
1722 | { |
1723 | return Err(Error::new(format!( |
1724 | - "({}) `use_token` use requires either the `server_password_command` set with a command that returns an Bearer token of your account, or `server_password` with the API Bearer token as a string. Consult documentation for guidance.", |
1725 | + "({}) `use_token` use requires either the `server_password_command` set with a \ |
1726 | + command that returns an Bearer token of your account, or `server_password` with \ |
1727 | + the API Bearer token as a string. Consult documentation for guidance.", |
1728 | s.name, |
1729 | ))); |
1730 | } |
1731 | @@ -416,7 +423,13 @@ impl MailBackend for JmapType { |
1732 | |
1733 | let upload_response: UploadResponse = match serde_json::from_str(&res_text) { |
1734 | Err(err) => { |
1735 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1736 | + let err = Error::new(format!( |
1737 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1738 | + report this!\nReply from server: {}", |
1739 | + &conn.server_conf.server_url, &res_text |
1740 | + )) |
1741 | + .set_source(Some(Arc::new(err))) |
1742 | + .set_kind(ErrorKind::Bug); |
1743 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1744 | return Err(err); |
1745 | } |
1746 | @@ -447,7 +460,13 @@ impl MailBackend for JmapType { |
1747 | |
1748 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
1749 | Err(err) => { |
1750 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1751 | + let err = Error::new(format!( |
1752 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1753 | + report this!\nReply from server: {}", |
1754 | + &conn.server_conf.server_url, &res_text |
1755 | + )) |
1756 | + .set_source(Some(Arc::new(err))) |
1757 | + .set_kind(ErrorKind::Bug); |
1758 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1759 | return Err(err); |
1760 | } |
1761 | @@ -528,7 +547,13 @@ impl MailBackend for JmapType { |
1762 | let res_text = res.text().await?; |
1763 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
1764 | Err(err) => { |
1765 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1766 | + let err = Error::new(format!( |
1767 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1768 | + report this!\nReply from server: {}", |
1769 | + &conn.server_conf.server_url, &res_text |
1770 | + )) |
1771 | + .set_source(Some(Arc::new(err))) |
1772 | + .set_kind(ErrorKind::Bug); |
1773 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1774 | return Err(err); |
1775 | } |
1776 | @@ -664,7 +689,13 @@ impl MailBackend for JmapType { |
1777 | |
1778 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
1779 | Err(err) => { |
1780 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1781 | + let err = Error::new(format!( |
1782 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1783 | + report this!\nReply from server: {}", |
1784 | + &conn.server_conf.server_url, &res_text |
1785 | + )) |
1786 | + .set_source(Some(Arc::new(err))) |
1787 | + .set_kind(ErrorKind::Bug); |
1788 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1789 | return Err(err); |
1790 | } |
1791 | @@ -771,12 +802,22 @@ impl MailBackend for JmapType { |
1792 | |
1793 | let res_text = res.text().await?; |
1794 | /* |
1795 | - *{"methodResponses":[["Email/set",{"notUpdated":null,"notDestroyed":null,"oldState":"86","newState":"87","accountId":"u148940c7","updated":{"M045926eed54b11423918f392":{"id":"M045926eed54b11423918f392"}},"created":null,"destroyed":null,"notCreated":null},"m3"]],"sessionState":"cyrus-0;p-5;vfs-0"} |
1796 | + *{"methodResponses":[["Email/set",{"notUpdated":null,"notDestroyed":null," |
1797 | + * oldState":"86","newState":"87","accountId":"u148940c7","updated":{" |
1798 | + * M045926eed54b11423918f392":{"id":"M045926eed54b11423918f392"}},"created": |
1799 | + * null,"destroyed":null,"notCreated":null},"m3"]],"sessionState":"cyrus-0; |
1800 | + * p-5;vfs-0"} |
1801 | */ |
1802 | //debug!("res_text = {}", &res_text); |
1803 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
1804 | Err(err) => { |
1805 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1806 | + let err = Error::new(format!( |
1807 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1808 | + report this!\nReply from server: {}", |
1809 | + &conn.server_conf.server_url, &res_text |
1810 | + )) |
1811 | + .set_source(Some(Arc::new(err))) |
1812 | + .set_kind(ErrorKind::Bug); |
1813 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1814 | return Err(err); |
1815 | } |
1816 | diff --git a/melib/src/backends/jmap/connection.rs b/melib/src/backends/jmap/connection.rs |
1817 | index fd47d2d..795fdaa 100644 |
1818 | --- a/melib/src/backends/jmap/connection.rs |
1819 | +++ b/melib/src/backends/jmap/connection.rs |
1820 | @@ -19,10 +19,12 @@ |
1821 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1822 | */ |
1823 | |
1824 | - use super::*; |
1825 | - use isahc::config::Configurable; |
1826 | use std::sync::MutexGuard; |
1827 | |
1828 | + use isahc::config::Configurable; |
1829 | + |
1830 | + use super::*; |
1831 | + |
1832 | #[derive(Debug)] |
1833 | pub struct JmapConnection { |
1834 | pub session: Arc<Mutex<JmapSession>>, |
1835 | @@ -73,11 +75,22 @@ impl JmapConnection { |
1836 | let mut jmap_session_resource_url = self.server_conf.server_url.to_string(); |
1837 | jmap_session_resource_url.push_str("/.well-known/jmap"); |
1838 | |
1839 | - let mut req = self.client.get_async(&jmap_session_resource_url).await.map_err(|err| { |
1840 | - let err = Error::new(format!("Could not connect to JMAP server endpoint for {}. Is your server url setting correct? (i.e. \"jmap.mailserver.org\") (Note: only session resource discovery via /.well-known/jmap is supported. DNS SRV records are not suppported.)\nError connecting to server: {}", &self.server_conf.server_url, &err)).set_source(Some(Arc::new(err))); |
1841 | + let mut req = self |
1842 | + .client |
1843 | + .get_async(&jmap_session_resource_url) |
1844 | + .await |
1845 | + .map_err(|err| { |
1846 | + let err = Error::new(format!( |
1847 | + "Could not connect to JMAP server endpoint for {}. Is your server url setting \ |
1848 | + correct? (i.e. \"jmap.mailserver.org\") (Note: only session resource \ |
1849 | + discovery via /.well-known/jmap is supported. DNS SRV records are not \ |
1850 | + suppported.)\nError connecting to server: {}", |
1851 | + &self.server_conf.server_url, &err |
1852 | + )) |
1853 | + .set_source(Some(Arc::new(err))); |
1854 | //*self.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1855 | err |
1856 | - })?; |
1857 | + })?; |
1858 | |
1859 | if !req.status().is_success() { |
1860 | let kind: crate::error::NetworkErrorKind = req.status().into(); |
1861 | @@ -95,7 +108,14 @@ impl JmapConnection { |
1862 | |
1863 | let session: JmapSession = match serde_json::from_str(&res_text) { |
1864 | Err(err) => { |
1865 | - let err = Error::new(format!("Could not connect to JMAP server endpoint for {}. Is your server url setting correct? (i.e. \"jmap.mailserver.org\") (Note: only session resource discovery via /.well-known/jmap is supported. DNS SRV records are not suppported.)\nReply from server: {}", &self.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))); |
1866 | + let err = Error::new(format!( |
1867 | + "Could not connect to JMAP server endpoint for {}. Is your server url setting \ |
1868 | + correct? (i.e. \"jmap.mailserver.org\") (Note: only session resource \ |
1869 | + discovery via /.well-known/jmap is supported. DNS SRV records are not \ |
1870 | + suppported.)\nReply from server: {}", |
1871 | + &self.server_conf.server_url, &res_text |
1872 | + )) |
1873 | + .set_source(Some(Arc::new(err))); |
1874 | *self.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1875 | return Err(err); |
1876 | } |
1877 | @@ -105,7 +125,17 @@ impl JmapConnection { |
1878 | .capabilities |
1879 | .contains_key("urn:ietf:params:jmap:core") |
1880 | { |
1881 | - let err = Error::new(format!("Server {} did not return JMAP Core capability (urn:ietf:params:jmap:core). Returned capabilities were: {}", &self.server_conf.server_url, session.capabilities.keys().map(String::as_str).collect::<Vec<&str>>().join(", "))); |
1882 | + let err = Error::new(format!( |
1883 | + "Server {} did not return JMAP Core capability (urn:ietf:params:jmap:core). \ |
1884 | + Returned capabilities were: {}", |
1885 | + &self.server_conf.server_url, |
1886 | + session |
1887 | + .capabilities |
1888 | + .keys() |
1889 | + .map(String::as_str) |
1890 | + .collect::<Vec<&str>>() |
1891 | + .join(", ") |
1892 | + )); |
1893 | *self.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1894 | return Err(err); |
1895 | } |
1896 | @@ -113,7 +143,17 @@ impl JmapConnection { |
1897 | .capabilities |
1898 | .contains_key("urn:ietf:params:jmap:mail") |
1899 | { |
1900 | - let err = Error::new(format!("Server {} does not support JMAP Mail capability (urn:ietf:params:jmap:mail). Returned capabilities were: {}", &self.server_conf.server_url, session.capabilities.keys().map(String::as_str).collect::<Vec<&str>>().join(", "))); |
1901 | + let err = Error::new(format!( |
1902 | + "Server {} does not support JMAP Mail capability (urn:ietf:params:jmap:mail). \ |
1903 | + Returned capabilities were: {}", |
1904 | + &self.server_conf.server_url, |
1905 | + session |
1906 | + .capabilities |
1907 | + .keys() |
1908 | + .map(String::as_str) |
1909 | + .collect::<Vec<&str>>() |
1910 | + .join(", ") |
1911 | + )); |
1912 | *self.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1913 | return Err(err); |
1914 | } |
1915 | @@ -207,7 +247,13 @@ impl JmapConnection { |
1916 | debug!(&res_text); |
1917 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
1918 | Err(err) => { |
1919 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &self.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
1920 | + let err = Error::new(format!( |
1921 | + "BUG: Could not deserialize {} server JSON response properly, please \ |
1922 | + report this!\nReply from server: {}", |
1923 | + &self.server_conf.server_url, &res_text |
1924 | + )) |
1925 | + .set_source(Some(Arc::new(err))) |
1926 | + .set_kind(ErrorKind::Bug); |
1927 | *self.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
1928 | return Err(err); |
1929 | } |
1930 | diff --git a/melib/src/backends/jmap/mailbox.rs b/melib/src/backends/jmap/mailbox.rs |
1931 | index 023fb1d..54aed08 100644 |
1932 | --- a/melib/src/backends/jmap/mailbox.rs |
1933 | +++ b/melib/src/backends/jmap/mailbox.rs |
1934 | @@ -19,9 +19,10 @@ |
1935 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1936 | */ |
1937 | |
1938 | + use std::sync::{Arc, Mutex, RwLock}; |
1939 | + |
1940 | use super::*; |
1941 | use crate::backends::{LazyCountSet, MailboxPermissions, SpecialUsageMailbox}; |
1942 | - use std::sync::{Arc, Mutex, RwLock}; |
1943 | |
1944 | #[derive(Debug, Clone)] |
1945 | pub struct JmapMailbox { |
1946 | diff --git a/melib/src/backends/jmap/objects/email.rs b/melib/src/backends/jmap/objects/email.rs |
1947 | index 461ce48..64e050a 100644 |
1948 | --- a/melib/src/backends/jmap/objects/email.rs |
1949 | +++ b/melib/src/backends/jmap/objects/email.rs |
1950 | @@ -19,15 +19,18 @@ |
1951 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
1952 | */ |
1953 | |
1954 | - use super::*; |
1955 | - use crate::backends::jmap::rfc8620::bool_false; |
1956 | - use crate::email::address::{Address, MailboxAddress}; |
1957 | use core::marker::PhantomData; |
1958 | - use serde::de::{Deserialize, Deserializer}; |
1959 | - use serde_json::value::RawValue; |
1960 | - use serde_json::Value; |
1961 | use std::collections::HashMap; |
1962 | |
1963 | + use serde::de::{Deserialize, Deserializer}; |
1964 | + use serde_json::{value::RawValue, Value}; |
1965 | + |
1966 | + use super::*; |
1967 | + use crate::{ |
1968 | + backends::jmap::rfc8620::bool_false, |
1969 | + email::address::{Address, MailboxAddress}, |
1970 | + }; |
1971 | + |
1972 | mod import; |
1973 | pub use import::*; |
1974 | |
1975 | @@ -83,14 +86,13 @@ impl Id<EmailObject> { |
1976 | // first character changed from "\" in IMAP to "$" in JMAP and have |
1977 | // particular semantic meaning: |
1978 | // |
1979 | - // * "$draft": The Email is a draft the user is composing. |
1980 | + // * "$draft": The Email is a draft the user is composing. |
1981 | // |
1982 | - // * "$seen": The Email has been read. |
1983 | + // * "$seen": The Email has been read. |
1984 | // |
1985 | - // * "$flagged": The Email has been flagged for urgent/special |
1986 | - // attention. |
1987 | + // * "$flagged": The Email has been flagged for urgent/special attention. |
1988 | // |
1989 | - // * "$answered": The Email has been replied to. |
1990 | + // * "$answered": The Email has been replied to. |
1991 | // |
1992 | // The IMAP "\Recent" keyword is not exposed via JMAP. The IMAP |
1993 | // "\Deleted" keyword is also not present: IMAP uses a delete+expunge |
1994 | @@ -115,19 +117,19 @@ impl Id<EmailObject> { |
1995 | // keywords in common use. New keywords may be established here in |
1996 | // the future. In particular, note: |
1997 | // |
1998 | - // * "$forwarded": The Email has been forwarded. |
1999 | + // * "$forwarded": The Email has been forwarded. |
2000 | // |
2001 | - // * "$phishing": The Email is highly likely to be phishing. |
2002 | - // Clients SHOULD warn users to take care when viewing this Email |
2003 | - // and disable links and attachments. |
2004 | + // * "$phishing": The Email is highly likely to be phishing. Clients SHOULD |
2005 | + // warn users to take care when viewing this Email and disable links and |
2006 | + // attachments. |
2007 | // |
2008 | - // * "$junk": The Email is definitely spam. Clients SHOULD set this |
2009 | - // flag when users report spam to help train automated spam- |
2010 | - // detection systems. |
2011 | + // * "$junk": The Email is definitely spam. Clients SHOULD set this flag |
2012 | + // when users report spam to help train automated spam- detection |
2013 | + // systems. |
2014 | // |
2015 | - // * "$notjunk": The Email is definitely not spam. Clients SHOULD |
2016 | - // set this flag when users indicate an Email is legitimate, to |
2017 | - // help train automated spam-detection systems. |
2018 | + // * "$notjunk": The Email is definitely not spam. Clients SHOULD set this |
2019 | + // flag when users indicate an Email is legitimate, to help train |
2020 | + // automated spam-detection systems. |
2021 | // |
2022 | // o size: "UnsignedInt" (immutable; server-set) |
2023 | // |
2024 | @@ -586,8 +588,10 @@ impl From<crate::search::Query> for Filter<EmailFilterCondition, EmailObject> { |
2025 | fn from(val: crate::search::Query) -> Self { |
2026 | let mut ret = Filter::Condition(EmailFilterCondition::new().into()); |
2027 | fn rec(q: &crate::search::Query, f: &mut Filter<EmailFilterCondition, EmailObject>) { |
2028 | - use crate::datetime::{timestamp_to_string, RFC3339_FMT}; |
2029 | - use crate::search::Query::*; |
2030 | + use crate::{ |
2031 | + datetime::{timestamp_to_string, RFC3339_FMT}, |
2032 | + search::Query::*, |
2033 | + }; |
2034 | match q { |
2035 | Subject(t) => { |
2036 | *f = Filter::Condition(EmailFilterCondition::new().subject(t.clone()).into()); |
2037 | @@ -849,8 +853,16 @@ pub struct EmailQueryChangesResponse { |
2038 | impl std::convert::TryFrom<&RawValue> for EmailQueryChangesResponse { |
2039 | type Error = crate::error::Error; |
2040 | fn try_from(t: &RawValue) -> Result<EmailQueryChangesResponse> { |
2041 | - let res: (String, EmailQueryChangesResponse, String) = |
2042 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug))?; |
2043 | + let res: (String, EmailQueryChangesResponse, String) = serde_json::from_str(t.get()) |
2044 | + .map_err(|err| { |
2045 | + crate::error::Error::new(format!( |
2046 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2047 | + this!\nReply from server: {}", |
2048 | + &t |
2049 | + )) |
2050 | + .set_source(Some(Arc::new(err))) |
2051 | + .set_kind(ErrorKind::Bug) |
2052 | + })?; |
2053 | assert_eq!(&res.0, "Email/queryChanges"); |
2054 | Ok(res.1) |
2055 | } |
2056 | diff --git a/melib/src/backends/jmap/objects/email/import.rs b/melib/src/backends/jmap/objects/email/import.rs |
2057 | index dffff92..475b9d3 100644 |
2058 | --- a/melib/src/backends/jmap/objects/email/import.rs |
2059 | +++ b/melib/src/backends/jmap/objects/email/import.rs |
2060 | @@ -19,9 +19,10 @@ |
2061 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2062 | */ |
2063 | |
2064 | - use super::*; |
2065 | use serde_json::value::RawValue; |
2066 | |
2067 | + use super::*; |
2068 | + |
2069 | /// #`import` |
2070 | /// |
2071 | /// Objects of type `Foo` are imported via a call to `Foo/import`. |
2072 | @@ -31,7 +32,6 @@ use serde_json::value::RawValue; |
2073 | /// - `account_id`: "Id" |
2074 | /// |
2075 | /// The id of the account to use. |
2076 | - /// |
2077 | #[derive(Deserialize, Serialize, Debug)] |
2078 | #[serde(rename_all = "camelCase")] |
2079 | pub struct ImportCall { |
2080 | @@ -81,10 +81,9 @@ impl ImportCall { |
2081 | } |
2082 | |
2083 | _impl!( |
2084 | - /// - accountId: "Id" |
2085 | + /// - accountId: "Id" |
2086 | /// |
2087 | /// The id of the account to use. |
2088 | - /// |
2089 | account_id: Id<Account> |
2090 | ); |
2091 | _impl!(if_in_state: Option<State<EmailObject>>); |
2092 | @@ -123,9 +122,10 @@ pub enum ImportError { |
2093 | AlreadyExists { |
2094 | description: Option<String>, |
2095 | /// An "existingId" property of type "Id" MUST be included on |
2096 | - ///the SetError object with the id of the existing Email. If duplicates |
2097 | - ///are allowed, the newly created Email object MUST have a separate id |
2098 | - ///and independent mutable properties to the existing object. |
2099 | + ///the SetError object with the id of the existing Email. If |
2100 | + /// duplicates are allowed, the newly created Email object MUST |
2101 | + /// have a separate id and independent mutable properties to the |
2102 | + /// existing object. |
2103 | existing_id: Id<EmailObject>, |
2104 | }, |
2105 | ///If the "blobId", "mailboxIds", or "keywords" properties are invalid |
2106 | @@ -146,7 +146,8 @@ pub enum ImportError { |
2107 | ///different to the "blobId" on the EmailImport object. Alternatively, |
2108 | ///the server MAY reject the import with an "invalidEmail" SetError. |
2109 | InvalidEmail { description: Option<String> }, |
2110 | - ///An "ifInState" argument was supplied, and it does not match the current state. |
2111 | + ///An "ifInState" argument was supplied, and it does not match the current |
2112 | + /// state. |
2113 | StateMismatch, |
2114 | } |
2115 | |
2116 | @@ -185,7 +186,15 @@ impl std::convert::TryFrom<&RawValue> for ImportResponse { |
2117 | type Error = crate::error::Error; |
2118 | fn try_from(t: &RawValue) -> Result<ImportResponse> { |
2119 | let res: (String, ImportResponse, String) = |
2120 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug))?; |
2121 | + serde_json::from_str(t.get()).map_err(|err| { |
2122 | + crate::error::Error::new(format!( |
2123 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2124 | + this!\nReply from server: {}", |
2125 | + &t |
2126 | + )) |
2127 | + .set_source(Some(Arc::new(err))) |
2128 | + .set_kind(ErrorKind::Bug) |
2129 | + })?; |
2130 | assert_eq!(&res.0, &ImportCall::NAME); |
2131 | Ok(res.1) |
2132 | } |
2133 | diff --git a/melib/src/backends/jmap/operations.rs b/melib/src/backends/jmap/operations.rs |
2134 | index ffe739c..b0fb0f3 100644 |
2135 | --- a/melib/src/backends/jmap/operations.rs |
2136 | +++ b/melib/src/backends/jmap/operations.rs |
2137 | @@ -19,9 +19,10 @@ |
2138 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2139 | */ |
2140 | |
2141 | - use super::*; |
2142 | use std::sync::Arc; |
2143 | |
2144 | + use super::*; |
2145 | + |
2146 | /// `BackendOp` implementor for Imap |
2147 | #[derive(Debug, Clone)] |
2148 | pub struct JmapOp { |
2149 | diff --git a/melib/src/backends/jmap/protocol.rs b/melib/src/backends/jmap/protocol.rs |
2150 | index 264ce63..e8c2709 100644 |
2151 | --- a/melib/src/backends/jmap/protocol.rs |
2152 | +++ b/melib/src/backends/jmap/protocol.rs |
2153 | @@ -19,11 +19,12 @@ |
2154 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2155 | */ |
2156 | |
2157 | - use super::mailbox::JmapMailbox; |
2158 | - use super::*; |
2159 | + use std::convert::{TryFrom, TryInto}; |
2160 | + |
2161 | use serde::Serialize; |
2162 | use serde_json::{json, Value}; |
2163 | - use std::convert::{TryFrom, TryInto}; |
2164 | + |
2165 | + use super::{mailbox::JmapMailbox, *}; |
2166 | |
2167 | pub type UtcDate = String; |
2168 | |
2169 | @@ -97,7 +98,13 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result<HashMap<MailboxHash, |
2170 | let res_text = res.text().await?; |
2171 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
2172 | Err(err) => { |
2173 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
2174 | + let err = Error::new(format!( |
2175 | + "BUG: Could not deserialize {} server JSON response properly, please report \ |
2176 | + this!\nReply from server: {}", |
2177 | + &conn.server_conf.server_url, &res_text |
2178 | + )) |
2179 | + .set_source(Some(Arc::new(err))) |
2180 | + .set_kind(ErrorKind::Bug); |
2181 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
2182 | return Err(err); |
2183 | } |
2184 | @@ -108,8 +115,9 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result<HashMap<MailboxHash, |
2185 | let GetResponse::<MailboxObject> { |
2186 | list, account_id, .. |
2187 | } = m; |
2188 | - // Is account set as `personal`? (`isPersonal` property). Then, even if `isSubscribed` is false |
2189 | - // on a mailbox, it should be regarded as subscribed. |
2190 | + // Is account set as `personal`? (`isPersonal` property). Then, even if |
2191 | + // `isSubscribed` is false on a mailbox, it should be regarded as |
2192 | + // subscribed. |
2193 | let is_personal: bool = { |
2194 | let session = conn.session_guard(); |
2195 | session |
2196 | @@ -204,7 +212,13 @@ pub async fn get_message_list( |
2197 | let res_text = res.text().await?; |
2198 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
2199 | Err(err) => { |
2200 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
2201 | + let err = Error::new(format!( |
2202 | + "BUG: Could not deserialize {} server JSON response properly, please report \ |
2203 | + this!\nReply from server: {}", |
2204 | + &conn.server_conf.server_url, &res_text |
2205 | + )) |
2206 | + .set_source(Some(Arc::new(err))) |
2207 | + .set_kind(ErrorKind::Bug); |
2208 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
2209 | return Err(err); |
2210 | } |
2211 | @@ -284,7 +298,13 @@ pub async fn fetch( |
2212 | |
2213 | let mut v: MethodResponse = match serde_json::from_str(&res_text) { |
2214 | Err(err) => { |
2215 | - let err = Error::new(format!("BUG: Could not deserialize {} server JSON response properly, please report this!\nReply from server: {}", &conn.server_conf.server_url, &res_text)).set_source(Some(Arc::new(err))).set_kind(ErrorKind::Bug); |
2216 | + let err = Error::new(format!( |
2217 | + "BUG: Could not deserialize {} server JSON response properly, please report \ |
2218 | + this!\nReply from server: {}", |
2219 | + &conn.server_conf.server_url, &res_text |
2220 | + )) |
2221 | + .set_source(Some(Arc::new(err))) |
2222 | + .set_kind(ErrorKind::Bug); |
2223 | *conn.store.online_status.lock().await = (Instant::now(), Err(err.clone())); |
2224 | return Err(err); |
2225 | } |
2226 | diff --git a/melib/src/backends/jmap/rfc8620.rs b/melib/src/backends/jmap/rfc8620.rs |
2227 | index bc394f5..fb55c5f 100644 |
2228 | --- a/melib/src/backends/jmap/rfc8620.rs |
2229 | +++ b/melib/src/backends/jmap/rfc8620.rs |
2230 | @@ -19,23 +19,30 @@ |
2231 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2232 | */ |
2233 | |
2234 | - use crate::email::parser::BytesExt; |
2235 | use core::marker::PhantomData; |
2236 | - use serde::de::DeserializeOwned; |
2237 | - use serde::ser::{Serialize, SerializeStruct, Serializer}; |
2238 | + use std::{ |
2239 | + hash::{Hash, Hasher}, |
2240 | + sync::Arc, |
2241 | + }; |
2242 | + |
2243 | + use serde::{ |
2244 | + de::DeserializeOwned, |
2245 | + ser::{Serialize, SerializeStruct, Serializer}, |
2246 | + }; |
2247 | use serde_json::{value::RawValue, Value}; |
2248 | - use std::hash::{Hash, Hasher}; |
2249 | - use std::sync::Arc; |
2250 | + |
2251 | + use crate::email::parser::BytesExt; |
2252 | |
2253 | mod filters; |
2254 | pub use filters::*; |
2255 | mod comparator; |
2256 | pub use comparator::*; |
2257 | mod argument; |
2258 | + use std::collections::HashMap; |
2259 | + |
2260 | pub use argument::*; |
2261 | |
2262 | use super::protocol::Method; |
2263 | - use std::collections::HashMap; |
2264 | pub trait Object { |
2265 | const NAME: &'static str; |
2266 | } |
2267 | @@ -275,7 +282,6 @@ impl Object for BlobObject { |
2268 | /// - `account_id`: "Id" |
2269 | /// |
2270 | /// The id of the account to use. |
2271 | - /// |
2272 | #[derive(Deserialize, Debug)] |
2273 | #[serde(rename_all = "camelCase")] |
2274 | pub struct Get<OBJ: Object> |
2275 | @@ -305,31 +311,30 @@ where |
2276 | } |
2277 | } |
2278 | _impl!( |
2279 | - /// - accountId: "Id" |
2280 | + /// - accountId: "Id" |
2281 | /// |
2282 | /// The id of the account to use. |
2283 | - /// |
2284 | account_id: Id<Account> |
2285 | ); |
2286 | _impl!( |
2287 | - /// - ids: `Option<JmapArgument<Vec<String>>>` |
2288 | - /// |
2289 | - /// The ids of the Foo objects to return. If `None`, then *all* records |
2290 | - /// of the data type are returned, if this is supported for that data |
2291 | - /// type and the number of records does not exceed the |
2292 | - /// "max_objects_in_get" limit. |
2293 | + /// - ids: `Option<JmapArgument<Vec<String>>>` |
2294 | /// |
2295 | + /// The ids of the Foo objects to return. If `None`, then *all* |
2296 | + /// records of the data type are returned, if this is |
2297 | + /// supported for that data type and the number of records |
2298 | + /// does not exceed the "max_objects_in_get" limit. |
2299 | ids: Option<JmapArgument<Vec<Id<OBJ>>>> |
2300 | ); |
2301 | _impl!( |
2302 | - /// - properties: Option<Vec<String>> |
2303 | + /// - properties: Option<Vec<String>> |
2304 | /// |
2305 | - /// If supplied, only the properties listed in the array are returned |
2306 | - /// for each `Foo` object. If `None`, all properties of the object are |
2307 | - /// returned. The `id` property of the object is *always* returned, |
2308 | - /// even if not explicitly requested. If an invalid property is |
2309 | - /// requested, the call WILL be rejected with an "invalid_arguments" |
2310 | - /// error. |
2311 | + /// If supplied, only the properties listed in the array are |
2312 | + /// returned for each `Foo` object. If `None`, all |
2313 | + /// properties of the object are returned. The `id` |
2314 | + /// property of the object is *always* returned, even if |
2315 | + /// not explicitly requested. If an invalid property is |
2316 | + /// requested, the call WILL be rejected with an |
2317 | + /// "invalid_arguments" error. |
2318 | properties: Option<Vec<String>> |
2319 | ); |
2320 | } |
2321 | @@ -414,7 +419,15 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for GetRes |
2322 | type Error = crate::error::Error; |
2323 | fn try_from(t: &RawValue) -> Result<GetResponse<OBJ>, crate::error::Error> { |
2324 | let res: (String, GetResponse<OBJ>, String) = |
2325 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(crate::error::ErrorKind::Bug))?; |
2326 | + serde_json::from_str(t.get()).map_err(|err| { |
2327 | + crate::error::Error::new(format!( |
2328 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2329 | + this!\nReply from server: {}", |
2330 | + &t |
2331 | + )) |
2332 | + .set_source(Some(Arc::new(err))) |
2333 | + .set_kind(crate::error::ErrorKind::Bug) |
2334 | + })?; |
2335 | assert_eq!(&res.0, &format!("{}/get", OBJ::NAME)); |
2336 | Ok(res.1) |
2337 | } |
2338 | @@ -519,7 +532,15 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for QueryR |
2339 | type Error = crate::error::Error; |
2340 | fn try_from(t: &RawValue) -> Result<QueryResponse<OBJ>, crate::error::Error> { |
2341 | let res: (String, QueryResponse<OBJ>, String) = |
2342 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(crate::error::ErrorKind::Bug))?; |
2343 | + serde_json::from_str(t.get()).map_err(|err| { |
2344 | + crate::error::Error::new(format!( |
2345 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2346 | + this!\nReply from server: {}", |
2347 | + &t |
2348 | + )) |
2349 | + .set_source(Some(Arc::new(err))) |
2350 | + .set_kind(crate::error::ErrorKind::Bug) |
2351 | + })?; |
2352 | assert_eq!(&res.0, &format!("{}/query", OBJ::NAME)); |
2353 | Ok(res.1) |
2354 | } |
2355 | @@ -543,8 +564,8 @@ impl<M: Method<OBJ>, OBJ: Object> ResultField<M, OBJ> { |
2356 | } |
2357 | } |
2358 | |
2359 | - // error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable |
2360 | - // --> melib/src/backends/jmap/rfc8620.rs:626:6 |
2361 | + // error[E0723]: trait bounds other than `Sized` on const fn parameters are |
2362 | + // unstable --> melib/src/backends/jmap/rfc8620.rs:626:6 |
2363 | // | |
2364 | // 626 | impl<M: Method<OBJ>, OBJ: Object> ResultField<M, OBJ> { |
2365 | // | ^ |
2366 | @@ -562,8 +583,9 @@ impl<M: Method<OBJ>, OBJ: Object> ResultField<M, OBJ> { |
2367 | |
2368 | /// #`changes` |
2369 | /// |
2370 | - /// The "Foo/changes" method allows a client to efficiently update the state of its Foo cache |
2371 | - /// to match the new state on the server. It takes the following arguments: |
2372 | + /// The "Foo/changes" method allows a client to efficiently update the state |
2373 | + /// of its Foo cache to match the new state on the server. It takes the |
2374 | + /// following arguments: |
2375 | /// |
2376 | /// - accountId: "Id" The id of the account to use. |
2377 | /// - sinceState: "String" |
2378 | @@ -579,7 +601,6 @@ impl<M: Method<OBJ>, OBJ: Object> ResultField<M, OBJ> { |
2379 | /// to return. If supplied by the client, the value MUST be a |
2380 | /// positive integer greater than 0. If a value outside of this range |
2381 | /// is given, the server MUST re |
2382 | - /// |
2383 | #[derive(Deserialize, Serialize, Debug)] |
2384 | #[serde(rename_all = "camelCase")] |
2385 | /* ch-ch-ch-ch-ch-Changes */ |
2386 | @@ -608,10 +629,9 @@ where |
2387 | } |
2388 | } |
2389 | _impl!( |
2390 | - /// - accountId: "Id" |
2391 | + /// - accountId: "Id" |
2392 | /// |
2393 | /// The id of the account to use. |
2394 | - /// |
2395 | account_id: Id<Account> |
2396 | ); |
2397 | _impl!( |
2398 | @@ -620,8 +640,6 @@ where |
2399 | /// returned as the "state" argument in the "Foo/get" response. The |
2400 | /// server will return the changes that have occurred since this |
2401 | /// state. |
2402 | - /// |
2403 | - /// |
2404 | since_state: State<OBJ> |
2405 | ); |
2406 | _impl!( |
2407 | @@ -630,8 +648,8 @@ where |
2408 | /// MAY choose to return fewer than this value but MUST NOT return |
2409 | /// more. If not given by the client, the server may choose how many |
2410 | /// to return. If supplied by the client, the value MUST be a |
2411 | - /// positive integer greater than 0. If a value outside of this range |
2412 | - /// is given, the server MUST re |
2413 | + /// positive integer greater than 0. If a value outside of this |
2414 | + /// range is given, the server MUST re |
2415 | max_changes: Option<u64> |
2416 | ); |
2417 | } |
2418 | @@ -654,7 +672,15 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for Change |
2419 | type Error = crate::error::Error; |
2420 | fn try_from(t: &RawValue) -> Result<ChangesResponse<OBJ>, crate::error::Error> { |
2421 | let res: (String, ChangesResponse<OBJ>, String) = |
2422 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(crate::error::ErrorKind::Bug))?; |
2423 | + serde_json::from_str(t.get()).map_err(|err| { |
2424 | + crate::error::Error::new(format!( |
2425 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2426 | + this!\nReply from server: {}", |
2427 | + &t |
2428 | + )) |
2429 | + .set_source(Some(Arc::new(err))) |
2430 | + .set_kind(crate::error::ErrorKind::Bug) |
2431 | + })?; |
2432 | assert_eq!(&res.0, &format!("{}/changes", OBJ::NAME)); |
2433 | Ok(res.1) |
2434 | } |
2435 | @@ -707,7 +733,6 @@ where |
2436 | /// |
2437 | /// The client MUST omit any properties that may only be set by the |
2438 | /// server (for example, the "id" property on most object types). |
2439 | - /// |
2440 | pub create: Option<HashMap<Id<OBJ>, OBJ>>, |
2441 | ///o update: "Id[PatchObject]|null" |
2442 | /// |
2443 | @@ -722,26 +747,26 @@ where |
2444 | /// All paths MUST also conform to the following restrictions; if |
2445 | /// there is any violation, the update MUST be rejected with an |
2446 | /// "invalidPatch" error: |
2447 | - /// * The pointer MUST NOT reference inside an array (i.e., you MUST |
2448 | - /// NOT insert/delete from an array; the array MUST be replaced in |
2449 | - /// its entirety instead). |
2450 | + /// * The pointer MUST NOT reference inside an array (i.e., you MUST NOT |
2451 | + /// insert/delete from an array; the array MUST be replaced in its |
2452 | + /// entirety instead). |
2453 | /// |
2454 | - /// * All parts prior to the last (i.e., the value after the final |
2455 | - /// slash) MUST already exist on the object being patched. |
2456 | + /// * All parts prior to the last (i.e., the value after the final slash) |
2457 | + /// MUST already exist on the object being patched. |
2458 | /// |
2459 | - /// * There MUST NOT be two patches in the PatchObject where the |
2460 | - /// pointer of one is the prefix of the pointer of the other, e.g., |
2461 | - /// "alerts/1/offset" and "alerts". |
2462 | + /// * There MUST NOT be two patches in the PatchObject where the pointer |
2463 | + /// of one is the prefix of the pointer of the other, e.g., |
2464 | + /// "alerts/1/offset" and "alerts". |
2465 | /// |
2466 | /// The value associated with each pointer determines how to apply |
2467 | /// that patch: |
2468 | /// |
2469 | - /// * If null, set to the default value if specified for this |
2470 | - /// property; otherwise, remove the property from the patched |
2471 | - /// object. If the key is not present in the parent, this a no-op. |
2472 | + /// * If null, set to the default value if specified for this property; |
2473 | + /// otherwise, remove the property from the patched object. If the key |
2474 | + /// is not present in the parent, this a no-op. |
2475 | /// |
2476 | - /// * Anything else: The value to set for this property (this may be |
2477 | - /// a replacement or addition to the object being patched). |
2478 | + /// * Anything else: The value to set for this property (this may be a |
2479 | + /// replacement or addition to the object being patched). |
2480 | /// |
2481 | /// Any server-set properties MAY be included in the patch if their |
2482 | /// value is identical to the current server value (before applying |
2483 | @@ -853,7 +878,15 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for SetRes |
2484 | type Error = crate::error::Error; |
2485 | fn try_from(t: &RawValue) -> Result<SetResponse<OBJ>, crate::error::Error> { |
2486 | let res: (String, SetResponse<OBJ>, String) = |
2487 | - serde_json::from_str(t.get()).map_err(|err| crate::error::Error::new(format!("BUG: Could not deserialize server JSON response properly, please report this!\nReply from server: {}", &t)).set_source(Some(Arc::new(err))).set_kind(crate::error::ErrorKind::Bug))?; |
2488 | + serde_json::from_str(t.get()).map_err(|err| { |
2489 | + crate::error::Error::new(format!( |
2490 | + "BUG: Could not deserialize server JSON response properly, please report \ |
2491 | + this!\nReply from server: {}", |
2492 | + &t |
2493 | + )) |
2494 | + .set_source(Some(Arc::new(err))) |
2495 | + .set_kind(crate::error::ErrorKind::Bug) |
2496 | + })?; |
2497 | assert_eq!(&res.0, &format!("{}/set", OBJ::NAME)); |
2498 | Ok(res.1) |
2499 | } |
2500 | @@ -863,31 +896,41 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for SetRes |
2501 | #[serde(rename_all = "camelCase")] |
2502 | #[serde(tag = "type", content = "description")] |
2503 | pub enum SetError { |
2504 | - ///(create; update; destroy). The create/update/destroy would violate an ACL or other permissions policy. |
2505 | + ///(create; update; destroy). The create/update/destroy would violate an |
2506 | + /// ACL or other permissions policy. |
2507 | Forbidden(Option<String>), |
2508 | - ///(create; update). The create would exceed a server- defined limit on the number or total size of objects of this type. |
2509 | + ///(create; update). The create would exceed a server- defined limit on |
2510 | + /// the number or total size of objects of this type. |
2511 | OverQuota(Option<String>), |
2512 | |
2513 | - ///(create; update). The create/update would result in an object that exceeds a server-defined limit for the maximum size of a single object of this type. |
2514 | + ///(create; update). The create/update would result in an object that |
2515 | + /// exceeds a server-defined limit for the maximum size of a single object |
2516 | + /// of this type. |
2517 | TooLarge(Option<String>), |
2518 | |
2519 | - ///(create). Too many objects of this type have been created recently, and a server-defined rate limit has been reached. It may work if tried again later. |
2520 | + ///(create). Too many objects of this type have been created recently, and |
2521 | + /// a server-defined rate limit has been reached. It may work if tried |
2522 | + /// again later. |
2523 | RateLimit(Option<String>), |
2524 | |
2525 | ///(update; destroy). The id given to update/destroy cannot be found. |
2526 | NotFound(Option<String>), |
2527 | |
2528 | - ///(update). The PatchObject given to update the record was not a valid patch (see the patch description). |
2529 | + ///(update). The PatchObject given to update the record was not a valid |
2530 | + /// patch (see the patch description). |
2531 | InvalidPatch(Option<String>), |
2532 | |
2533 | - ///(update). The client requested that an object be both updated and destroyed in the same /set request, and the server has decided to therefore ignore the update. |
2534 | + ///(update). The client requested that an object be both updated and |
2535 | + /// destroyed in the same /set request, and the server has decided to |
2536 | + /// therefore ignore the update. |
2537 | WillDestroy(Option<String>), |
2538 | ///(create; update). The record given is invalid in some way. |
2539 | InvalidProperties { |
2540 | description: Option<String>, |
2541 | properties: Vec<String>, |
2542 | }, |
2543 | - ///(create; destroy). This is a singleton type, so you cannot create another one or destroy the existing one. |
2544 | + ///(create; destroy). This is a singleton type, so you cannot create |
2545 | + /// another one or destroy the existing one. |
2546 | Singleton(Option<String>), |
2547 | RequestTooLarge(Option<String>), |
2548 | StateMismatch(Option<String>), |
2549 | @@ -1001,8 +1044,9 @@ pub struct UploadResponse { |
2550 | pub account_id: Id<Account>, |
2551 | ///o blobId: "Id" |
2552 | /// |
2553 | - ///The id representing the binary data uploaded. The data for this id is immutable. |
2554 | - ///The id *only* refers to the binary data, not any metadata. |
2555 | + ///The id representing the binary data uploaded. The data for this id is |
2556 | + /// immutable. The id *only* refers to the binary data, not any |
2557 | + /// metadata. |
2558 | pub blob_id: Id<BlobObject>, |
2559 | ///o type: "String" |
2560 | /// |
2561 | @@ -1098,11 +1142,15 @@ where |
2562 | pub struct QueryChangesResponse<OBJ: Object> { |
2563 | /// The id of the account used for the call. |
2564 | pub account_id: Id<Account>, |
2565 | - /// This is the "sinceQueryState" argument echoed back; that is, the state from which the server is returning changes. |
2566 | + /// This is the "sinceQueryState" argument echoed back; that is, the state |
2567 | + /// from which the server is returning changes. |
2568 | pub old_query_state: String, |
2569 | - ///This is the state the query will be in after applying the set of changes to the old state. |
2570 | + ///This is the state the query will be in after applying the set of changes |
2571 | + /// to the old state. |
2572 | pub new_query_state: String, |
2573 | - /// The total number of Foos in the results (given the "filter"). This argument MUST be omitted if the "calculateTotal" request argument is not true. |
2574 | + /// The total number of Foos in the results (given the "filter"). This |
2575 | + /// argument MUST be omitted if the "calculateTotal" request argument is not |
2576 | + /// true. |
2577 | #[serde(default)] |
2578 | pub total: Option<usize>, |
2579 | ///The "id" for every Foo that was in the query results in the old |
2580 | @@ -1139,9 +1187,9 @@ pub struct QueryChangesResponse<OBJ: Object> { |
2581 | |
2582 | ///An *AddedItem* object has the following properties: |
2583 | |
2584 | - ///* id: "Id" |
2585 | + /// * id: "Id" |
2586 | |
2587 | - ///* index: "UnsignedInt" |
2588 | + /// * index: "UnsignedInt" |
2589 | |
2590 | ///The result of this is that if the client has a cached sparse array of |
2591 | ///Foo ids corresponding to the results in the old state, then: |
2592 | diff --git a/melib/src/backends/jmap/rfc8620/argument.rs b/melib/src/backends/jmap/rfc8620/argument.rs |
2593 | index 1410d0b..932579b 100644 |
2594 | --- a/melib/src/backends/jmap/rfc8620/argument.rs |
2595 | +++ b/melib/src/backends/jmap/rfc8620/argument.rs |
2596 | @@ -19,9 +19,10 @@ |
2597 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2598 | */ |
2599 | |
2600 | - use crate::backends::jmap::protocol::Method; |
2601 | - use crate::backends::jmap::rfc8620::Object; |
2602 | - use crate::backends::jmap::rfc8620::ResultField; |
2603 | + use crate::backends::jmap::{ |
2604 | + protocol::Method, |
2605 | + rfc8620::{Object, ResultField}, |
2606 | + }; |
2607 | |
2608 | #[derive(Deserialize, Serialize, Debug)] |
2609 | #[serde(rename_all = "camelCase")] |
2610 | diff --git a/melib/src/backends/maildir.rs b/melib/src/backends/maildir.rs |
2611 | index dbfd57f..97b4aaf 100644 |
2612 | --- a/melib/src/backends/maildir.rs |
2613 | +++ b/melib/src/backends/maildir.rs |
2614 | @@ -24,19 +24,24 @@ mod backend; |
2615 | pub use self::backend::*; |
2616 | |
2617 | mod stream; |
2618 | - pub use stream::*; |
2619 | + use std::{ |
2620 | + collections::hash_map::DefaultHasher, |
2621 | + fs, |
2622 | + hash::{Hash, Hasher}, |
2623 | + io::{BufReader, Read}, |
2624 | + path::{Path, PathBuf}, |
2625 | + sync::{Arc, Mutex}, |
2626 | + }; |
2627 | |
2628 | - use crate::backends::*; |
2629 | - use crate::email::Flag; |
2630 | - use crate::error::{Error, Result}; |
2631 | - use crate::shellexpand::ShellExpandTrait; |
2632 | use futures::stream::Stream; |
2633 | - use std::collections::hash_map::DefaultHasher; |
2634 | - use std::fs; |
2635 | - use std::hash::{Hash, Hasher}; |
2636 | - use std::io::{BufReader, Read}; |
2637 | - use std::path::{Path, PathBuf}; |
2638 | - use std::sync::{Arc, Mutex}; |
2639 | + pub use stream::*; |
2640 | + |
2641 | + use crate::{ |
2642 | + backends::*, |
2643 | + email::Flag, |
2644 | + error::{Error, Result}, |
2645 | + shellexpand::ShellExpandTrait, |
2646 | + }; |
2647 | |
2648 | /// `BackendOp` implementor for Maildir |
2649 | #[derive(Debug)] |
2650 | @@ -96,7 +101,7 @@ impl<'a> BackendOp for MaildirOp { |
2651 | let file = std::fs::OpenOptions::new() |
2652 | .read(true) |
2653 | .write(false) |
2654 | - .open(&self.path()?)?; |
2655 | + .open(self.path()?)?; |
2656 | let mut buf_reader = BufReader::new(file); |
2657 | let mut contents = Vec::new(); |
2658 | buf_reader.read_to_end(&mut contents)?; |
2659 | @@ -141,8 +146,8 @@ impl MaildirMailbox { |
2660 | let mut h = DefaultHasher::new(); |
2661 | pathbuf.hash(&mut h); |
2662 | |
2663 | - /* Check if mailbox path (Eg `INBOX/Lists/luddites`) is included in the subscribed |
2664 | - * mailboxes in user configuration */ |
2665 | + /* Check if mailbox path (Eg `INBOX/Lists/luddites`) is included in the |
2666 | + * subscribed mailboxes in user configuration */ |
2667 | let fname = pathbuf |
2668 | .strip_prefix( |
2669 | PathBuf::from(&settings.root_mailbox) |
2670 | @@ -279,7 +284,11 @@ impl MaildirPathTrait for Path { |
2671 | 'S' => flag |= Flag::SEEN, |
2672 | 'T' => flag |= Flag::TRASHED, |
2673 | _ => { |
2674 | - debug!("DEBUG: in MaildirPathTrait::flags(), encountered unknown flag marker {:?}, path is {}", f, path); |
2675 | + debug!( |
2676 | + "DEBUG: in MaildirPathTrait::flags(), encountered unknown flag marker \ |
2677 | + {:?}, path is {}", |
2678 | + f, path |
2679 | + ); |
2680 | } |
2681 | } |
2682 | } |
2683 | diff --git a/melib/src/backends/maildir/backend.rs b/melib/src/backends/maildir/backend.rs |
2684 | index 0ca01fc..620d3c0 100644 |
2685 | --- a/melib/src/backends/maildir/backend.rs |
2686 | +++ b/melib/src/backends/maildir/backend.rs |
2687 | @@ -21,32 +21,36 @@ |
2688 | |
2689 | //! # Maildir Backend |
2690 | //! |
2691 | - //! This module implements a maildir backend according to the maildir specification. |
2692 | - //! <https://cr.yp.to/proto/maildir.html> |
2693 | + //! This module implements a maildir backend according to the maildir |
2694 | + //! specification. <https://cr.yp.to/proto/maildir.html> |
2695 | |
2696 | - use super::{MaildirMailbox, MaildirOp, MaildirPathTrait}; |
2697 | - use crate::backends::{RefreshEventKind::*, *}; |
2698 | - use crate::conf::AccountSettings; |
2699 | - use crate::email::{Envelope, EnvelopeHash, Flag}; |
2700 | - use crate::error::{Error, ErrorKind, Result}; |
2701 | - use crate::shellexpand::ShellExpandTrait; |
2702 | - use crate::Collection; |
2703 | use futures::prelude::Stream; |
2704 | |
2705 | + use super::{MaildirMailbox, MaildirOp, MaildirPathTrait}; |
2706 | + use crate::{ |
2707 | + backends::{RefreshEventKind::*, *}, |
2708 | + conf::AccountSettings, |
2709 | + email::{Envelope, EnvelopeHash, Flag}, |
2710 | + error::{Error, ErrorKind, Result}, |
2711 | + shellexpand::ShellExpandTrait, |
2712 | + Collection, |
2713 | + }; |
2714 | + |
2715 | extern crate notify; |
2716 | + use std::{ |
2717 | + collections::{hash_map::DefaultHasher, HashMap, HashSet}, |
2718 | + ffi::OsStr, |
2719 | + fs, |
2720 | + hash::{Hash, Hasher}, |
2721 | + io::{self, Read, Write}, |
2722 | + ops::{Deref, DerefMut}, |
2723 | + os::unix::fs::PermissionsExt, |
2724 | + path::{Component, Path, PathBuf}, |
2725 | + sync::{mpsc::channel, Arc, Mutex}, |
2726 | + time::Duration, |
2727 | + }; |
2728 | + |
2729 | use self::notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; |
2730 | - use std::time::Duration; |
2731 | - |
2732 | - use std::collections::{hash_map::DefaultHasher, HashMap, HashSet}; |
2733 | - use std::ffi::OsStr; |
2734 | - use std::fs; |
2735 | - use std::hash::{Hash, Hasher}; |
2736 | - use std::io::{self, Read, Write}; |
2737 | - use std::ops::{Deref, DerefMut}; |
2738 | - use std::os::unix::fs::PermissionsExt; |
2739 | - use std::path::{Component, Path, PathBuf}; |
2740 | - use std::sync::mpsc::channel; |
2741 | - use std::sync::{Arc, Mutex}; |
2742 | |
2743 | #[derive(Clone, Debug, PartialEq)] |
2744 | pub(super) enum PathMod { |
2745 | @@ -669,7 +673,10 @@ impl MailBackend for MaildirType { |
2746 | e.modified = Some(PathMod::Hash(new_hash)); |
2747 | e.removed = false; |
2748 | }); |
2749 | - debug!("contains_old_key, key was marked as removed (by external source)"); |
2750 | + debug!( |
2751 | + "contains_old_key, key was marked as removed (by external \ |
2752 | + source)" |
2753 | + ); |
2754 | } else { |
2755 | debug!("not contains_new_key"); |
2756 | } |
2757 | @@ -893,7 +900,7 @@ impl MailBackend for MaildirType { |
2758 | Some(PathMod::Path(new_name.clone())); |
2759 | |
2760 | debug!("renaming {:?} to {:?}", path, new_name); |
2761 | - fs::rename(&path, &new_name)?; |
2762 | + fs::rename(path, &new_name)?; |
2763 | debug!("success in rename"); |
2764 | } |
2765 | Ok(()) |
2766 | @@ -996,12 +1003,16 @@ impl MailBackend for MaildirType { |
2767 | let mut path = self.path.clone(); |
2768 | path.push(&new_path); |
2769 | if !path.starts_with(&self.path) { |
2770 | - return Err(Error::new(format!("Path given (`{}`) is absolute. Please provide a path relative to the account's root mailbox.", &new_path))); |
2771 | + return Err(Error::new(format!( |
2772 | + "Path given (`{}`) is absolute. Please provide a path relative to the account's \ |
2773 | + root mailbox.", |
2774 | + &new_path |
2775 | + ))); |
2776 | } |
2777 | |
2778 | std::fs::create_dir(&path)?; |
2779 | - /* create_dir does not create intermediate directories (like `mkdir -p`), so the parent must be a valid |
2780 | - * mailbox at this point. */ |
2781 | + /* create_dir does not create intermediate directories (like `mkdir -p`), so |
2782 | + * the parent must be a valid mailbox at this point. */ |
2783 | |
2784 | let parent = path.parent().and_then(|p| { |
2785 | self.mailboxes |
2786 | @@ -1143,8 +1154,9 @@ impl MaildirType { |
2787 | children.push(f.hash); |
2788 | mailboxes.insert(f.hash, f); |
2789 | } else { |
2790 | - /* If directory is invalid (i.e. has no {cur,new,tmp} subfolders), |
2791 | - * accept it ONLY if it contains subdirs of any depth that are |
2792 | + /* If directory is invalid (i.e. has no {cur,new,tmp} |
2793 | + * subfolders), accept it ONLY if |
2794 | + * it contains subdirs of any depth that are |
2795 | * valid maildir paths |
2796 | */ |
2797 | let subdirs = recurse_mailboxes(mailboxes, settings, &path)?; |
2798 | @@ -1379,7 +1391,7 @@ fn add_path_to_index( |
2799 | map.len() |
2800 | ); |
2801 | } |
2802 | - let mut reader = io::BufReader::new(fs::File::open(&path)?); |
2803 | + let mut reader = io::BufReader::new(fs::File::open(path)?); |
2804 | buf.clear(); |
2805 | reader.read_to_end(buf)?; |
2806 | let mut env = Envelope::from_bytes(buf.as_slice(), Some(path.flags()))?; |
2807 | diff --git a/melib/src/backends/maildir/stream.rs b/melib/src/backends/maildir/stream.rs |
2808 | index adc408f..c0bc57c 100644 |
2809 | --- a/melib/src/backends/maildir/stream.rs |
2810 | +++ b/melib/src/backends/maildir/stream.rs |
2811 | @@ -19,17 +19,22 @@ |
2812 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
2813 | */ |
2814 | |
2815 | + use core::{future::Future, pin::Pin}; |
2816 | + use std::{ |
2817 | + io::{self, Read}, |
2818 | + os::unix::fs::PermissionsExt, |
2819 | + path::PathBuf, |
2820 | + result, |
2821 | + sync::{Arc, Mutex}, |
2822 | + }; |
2823 | + |
2824 | + use futures::{ |
2825 | + stream::{FuturesUnordered, StreamExt}, |
2826 | + task::{Context, Poll}, |
2827 | + }; |
2828 | + |
2829 | use super::*; |
2830 | use crate::backends::maildir::backend::move_to_cur; |
2831 | - use core::future::Future; |
2832 | - use core::pin::Pin; |
2833 | - use futures::stream::{FuturesUnordered, StreamExt}; |
2834 | - use futures::task::{Context, Poll}; |
2835 | - use std::io::{self, Read}; |
2836 | - use std::os::unix::fs::PermissionsExt; |
2837 | - use std::path::PathBuf; |
2838 | - use std::result; |
2839 | - use std::sync::{Arc, Mutex}; |
2840 | |
2841 | pub struct MaildirStream { |
2842 | payloads: Pin< |
2843 | @@ -66,7 +71,7 @@ impl MaildirStream { |
2844 | files |
2845 | .chunks(chunk_size) |
2846 | .map(|chunk| { |
2847 | - let cache_dir = xdg::BaseDirectories::with_profile("meli", &name).unwrap(); |
2848 | + let cache_dir = xdg::BaseDirectories::with_profile("meli", name).unwrap(); |
2849 | Box::pin(Self::chunk( |
2850 | SmallVec::from(chunk), |
2851 | cache_dir, |
2852 | diff --git a/melib/src/backends/mbox.rs b/melib/src/backends/mbox.rs |
2853 | index 3f8a1a8..0304a95 100644 |
2854 | --- a/melib/src/backends/mbox.rs |
2855 | +++ b/melib/src/backends/mbox.rs |
2856 | @@ -31,36 +31,44 @@ |
2857 | //! |
2858 | //! `mbox` describes a family of incompatible legacy formats. |
2859 | //! |
2860 | - //! "All of the 'mbox' formats store all of the messages in the mailbox in a single file. Delivery appends new messages to the end of the file." [^0] |
2861 | + //! "All of the 'mbox' formats store all of the messages in the mailbox in a |
2862 | + //! single file. Delivery appends new messages to the end of the file." [^0] |
2863 | //! |
2864 | - //! "Each message is preceded by a From_ line and followed by a blank line. A From_ line is a line that begins with the five characters 'F', 'r', 'o', 'm', and ' '." [^0] |
2865 | + //! "Each message is preceded by a From_ line and followed by a blank line. A |
2866 | + //! From_ line is a line that begins with the five characters 'F', 'r', 'o', |
2867 | + //! 'm', and ' '." [^0] |
2868 | //! |
2869 | //! ## `From ` / postmark line |
2870 | //! |
2871 | - //! "An mbox is a text file containing an arbitrary number of e-mail messages. Each message |
2872 | - //! consists of a postmark, followed by an e-mail message formatted according to RFC822, RFC2822. |
2873 | - //! The file format is line-oriented. Lines are separated by line feed characters (ASCII 10). |
2874 | + //! "An mbox is a text file containing an arbitrary number of e-mail messages. |
2875 | + //! Each message consists of a postmark, followed by an e-mail message formatted |
2876 | + //! according to RFC822, RFC2822. The file format is line-oriented. Lines are |
2877 | + //! separated by line feed characters (ASCII 10). |
2878 | //! |
2879 | - //! "A postmark line consists of the four characters 'From', followed by a space character, |
2880 | - //! followed by the message's envelope sender address, followed by whitespace, and followed by a |
2881 | - //! time stamp. This line is often called From_ line. |
2882 | + //! "A postmark line consists of the four characters 'From', followed by a space |
2883 | + //! character, followed by the message's envelope sender address, followed by |
2884 | + //! whitespace, and followed by a time stamp. This line is often called From_ |
2885 | + //! line. |
2886 | //! |
2887 | - //! "The sender address is expected to be addr-spec as defined in RFC2822 3.4.1. The date is expected |
2888 | - //! to be date-time as output by asctime(3). For compatibility reasons with legacy software, |
2889 | - //! two-digit years greater than or equal to 70 should be interpreted as the years 1970+, while |
2890 | - //! two-digit years less than 70 should be interpreted as the years 2000-2069. Software reading |
2891 | - //! files in this format should also be prepared to accept non-numeric timezone information such as |
2892 | - //! 'CET DST' for Central European Time, daylight saving time. |
2893 | + //! "The sender address is expected to be addr-spec as defined in RFC2822 3.4.1. |
2894 | + //! The date is expected to be date-time as output by asctime(3). For |
2895 | + //! compatibility reasons with legacy software, two-digit years greater than or |
2896 | + //! equal to 70 should be interpreted as the years 1970+, while two-digit years |
2897 | + //! less than 70 should be interpreted as the years 2000-2069. Software reading |
2898 | + //! files in this format should also be prepared to accept non-numeric timezone |
2899 | + //! information such as 'CET DST' for Central European Time, daylight saving |
2900 | + //! time. |
2901 | //! |
2902 | //! "Example: |
2903 | //! |
2904 | //!```text |
2905 | - //!From example@example.com Fri Jun 23 02:56:55 2000 |
2906 | - //!``` |
2907 | + //! From example@example.com Fri Jun 23 02:56:55 2000 |
2908 | + //! ``` |
2909 | //! |
2910 | - //! "In order to avoid misinterpretation of lines in message bodies which begin with the four |
2911 | - //! characters 'From', followed by a space character, the mail delivery agent must quote |
2912 | - //! any occurrence of 'From ' at the start of a body line." [^2] |
2913 | + //! "In order to avoid misinterpretation of lines in message bodies which begin |
2914 | + //! with the four characters 'From', followed by a space character, the mail |
2915 | + //! delivery agent must quote any occurrence of 'From ' at the start of a body |
2916 | + //! line." [^2] |
2917 | //! |
2918 | //! ## Metadata |
2919 | //! |
2920 | @@ -77,7 +85,8 @@ |
2921 | //! # use std::collections::HashMap; |
2922 | //! # use std::sync::{Arc, Mutex}; |
2923 | //! let file_contents = vec![]; // Replace with actual mbox file contents |
2924 | - //! let index: Arc<Mutex<HashMap<EnvelopeHash, (Offset, Length)>>> = Arc::new(Mutex::new(HashMap::default())); |
2925 | + //! let index: Arc<Mutex<HashMap<EnvelopeHash, (Offset, Length)>>> = |
2926 | + //! Arc::new(Mutex::new(HashMap::default())); |
2927 | //! let mut message_iter = MessageIterator { |
2928 | //! index: index.clone(), |
2929 | //! input: &file_contents.as_slice(), |
2930 | @@ -100,9 +109,9 @@ |
2931 | //! format.append( |
2932 | //! &mut file, |
2933 | //! mbox_1, |
2934 | - //! None, // Envelope From |
2935 | + //! None, // Envelope From |
2936 | //! Some(melib::datetime::now()), // Delivered date |
2937 | - //! Default::default(), // Flags and tags |
2938 | + //! Default::default(), // Flags and tags |
2939 | //! MboxMetadata::None, |
2940 | //! true, |
2941 | //! false, |
2942 | @@ -121,29 +130,37 @@ |
2943 | //! # Ok::<(), melib::Error>(()) |
2944 | //! ``` |
2945 | |
2946 | - use crate::backends::*; |
2947 | - use crate::collection::Collection; |
2948 | - use crate::conf::AccountSettings; |
2949 | - use crate::email::parser::BytesExt; |
2950 | - use crate::email::*; |
2951 | - use crate::error::{Error, ErrorKind, Result}; |
2952 | - use crate::get_path_hash; |
2953 | - use crate::shellexpand::ShellExpandTrait; |
2954 | - use nom::bytes::complete::tag; |
2955 | - use nom::character::complete::digit1; |
2956 | - use nom::combinator::map_res; |
2957 | - use nom::{self, error::Error as NomError, error::ErrorKind as NomErrorKind, IResult}; |
2958 | + use nom::{ |
2959 | + self, |
2960 | + bytes::complete::tag, |
2961 | + character::complete::digit1, |
2962 | + combinator::map_res, |
2963 | + error::{Error as NomError, ErrorKind as NomErrorKind}, |
2964 | + IResult, |
2965 | + }; |
2966 | + |
2967 | + use crate::{ |
2968 | + backends::*, |
2969 | + collection::Collection, |
2970 | + conf::AccountSettings, |
2971 | + email::{parser::BytesExt, *}, |
2972 | + error::{Error, ErrorKind, Result}, |
2973 | + get_path_hash, |
2974 | + shellexpand::ShellExpandTrait, |
2975 | + }; |
2976 | |
2977 | extern crate notify; |
2978 | + use std::{ |
2979 | + collections::hash_map::HashMap, |
2980 | + fs::File, |
2981 | + io::{BufReader, Read}, |
2982 | + os::unix::io::AsRawFd, |
2983 | + path::{Path, PathBuf}, |
2984 | + str::FromStr, |
2985 | + sync::{mpsc::channel, Arc, Mutex, RwLock}, |
2986 | + }; |
2987 | + |
2988 | use self::notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; |
2989 | - use std::collections::hash_map::HashMap; |
2990 | - use std::fs::File; |
2991 | - use std::io::{BufReader, Read}; |
2992 | - use std::os::unix::io::AsRawFd; |
2993 | - use std::path::{Path, PathBuf}; |
2994 | - use std::str::FromStr; |
2995 | - use std::sync::mpsc::channel; |
2996 | - use std::sync::{Arc, Mutex, RwLock}; |
2997 | |
2998 | pub mod write; |
2999 | |
3000 | @@ -163,7 +180,8 @@ fn get_rw_lock_blocking(f: &File, path: &Path) -> Result<()> { |
3001 | l_start: 0, |
3002 | l_len: 0, /* "Specifying 0 for l_len has the special meaning: lock all bytes starting at the location |
3003 | specified by l_whence and l_start through to the end of file, no matter how large the file grows." */ |
3004 | - l_pid: 0, /* "By contrast with traditional record locks, the l_pid field of that structure must be set to zero when using the commands described below." */ |
3005 | + l_pid: 0, /* "By contrast with traditional record locks, the l_pid field of that |
3006 | + * structure must be set to zero when using the commands described below." */ |
3007 | #[cfg(target_os = "freebsd")] |
3008 | l_sysid: 0, |
3009 | }; |
3010 | @@ -368,9 +386,12 @@ impl BackendOp for MboxOp { |
3011 | |
3012 | #[derive(Debug, Clone, Copy)] |
3013 | pub enum MboxMetadata { |
3014 | - /// Dovecot uses C-Client (ie. UW-IMAP, Pine) compatible headers in mbox messages to store me |
3015 | - /// - X-IMAPbase: Contains UIDVALIDITY, last used UID and list of used keywords |
3016 | - /// - X-IMAP: Same as X-IMAPbase but also specifies that the message is a “pseudo message” |
3017 | + /// Dovecot uses C-Client (ie. UW-IMAP, Pine) compatible headers in mbox |
3018 | + /// messages to store me |
3019 | + /// - X-IMAPbase: Contains UIDVALIDITY, last used UID and list of used |
3020 | + /// keywords |
3021 | + /// - X-IMAP: Same as X-IMAPbase but also specifies that the message is a |
3022 | + /// “pseudo message” |
3023 | /// - X-UID: Message’s allocated UID |
3024 | /// - Status: R (Seen) and O (non-Recent) flags |
3025 | /// - X-Status: A (Answered), F (Flagged), T (Draft) and D (Deleted) flags |
3026 | @@ -380,8 +401,8 @@ pub enum MboxMetadata { |
3027 | None, |
3028 | } |
3029 | |
3030 | - /// Choose between "mboxo", "mboxrd", "mboxcl", "mboxcl2". For new mailboxes, prefer "mboxcl2" |
3031 | - /// which does not alter the mail body. |
3032 | + /// Choose between "mboxo", "mboxrd", "mboxcl", "mboxcl2". For new mailboxes, |
3033 | + /// prefer "mboxcl2" which does not alter the mail body. |
3034 | #[derive(Debug, Clone, Copy)] |
3035 | pub enum MboxFormat { |
3036 | MboxO, |
3037 | @@ -1406,7 +1427,8 @@ impl MboxType { |
3038 | ); |
3039 | } else { |
3040 | return Err(Error::new(format!( |
3041 | - "mbox mailbox configuration entry \"{}\" should have a \"path\" value set pointing to an mbox file.", |
3042 | + "mbox mailbox configuration entry \"{}\" should have a \"path\" value set \ |
3043 | + pointing to an mbox file.", |
3044 | k |
3045 | ))); |
3046 | } |
3047 | diff --git a/melib/src/backends/nntp.rs b/melib/src/backends/nntp.rs |
3048 | index 4615bc9..a6d96f2 100644 |
3049 | --- a/melib/src/backends/nntp.rs |
3050 | +++ b/melib/src/backends/nntp.rs |
3051 | @@ -21,14 +21,14 @@ |
3052 | |
3053 | //! # NNTP backend / client |
3054 | //! |
3055 | - //! Implements an NNTP client as specified by [RFC 3977: Network News Transfer Protocol |
3056 | - //! (NNTP)](https://datatracker.ietf.org/doc/html/rfc3977). Also implements [RFC 6048: Network News |
3057 | + //! Implements an NNTP client as specified by [RFC 3977: Network News Transfer |
3058 | + //! Protocol (NNTP)](https://datatracker.ietf.org/doc/html/rfc3977). Also implements [RFC 6048: Network News |
3059 | //! Transfer Protocol (NNTP) Additions to LIST |
3060 | //! Command](https://datatracker.ietf.org/doc/html/rfc6048). |
3061 | |
3062 | - use crate::get_conf_val; |
3063 | - use crate::get_path_hash; |
3064 | use smallvec::SmallVec; |
3065 | + |
3066 | + use crate::{get_conf_val, get_path_hash}; |
3067 | #[macro_use] |
3068 | mod protocol_parser; |
3069 | pub use protocol_parser::*; |
3070 | @@ -37,21 +37,26 @@ pub use mailbox::*; |
3071 | mod operations; |
3072 | pub use operations::*; |
3073 | mod connection; |
3074 | - pub use connection::*; |
3075 | + use std::{ |
3076 | + collections::{hash_map::DefaultHasher, BTreeSet, HashMap, HashSet}, |
3077 | + hash::Hasher, |
3078 | + pin::Pin, |
3079 | + str::FromStr, |
3080 | + sync::{Arc, Mutex}, |
3081 | + time::{Duration, Instant}, |
3082 | + }; |
3083 | |
3084 | - use crate::conf::AccountSettings; |
3085 | - use crate::connections::timeout; |
3086 | - use crate::email::*; |
3087 | - use crate::error::{Error, Result, ResultIntoError}; |
3088 | - use crate::{backends::*, Collection}; |
3089 | - use futures::lock::Mutex as FutureMutex; |
3090 | - use futures::stream::Stream; |
3091 | - use std::collections::{hash_map::DefaultHasher, BTreeSet, HashMap, HashSet}; |
3092 | - use std::hash::Hasher; |
3093 | - use std::pin::Pin; |
3094 | - use std::str::FromStr; |
3095 | - use std::sync::{Arc, Mutex}; |
3096 | - use std::time::{Duration, Instant}; |
3097 | + pub use connection::*; |
3098 | + use futures::{lock::Mutex as FutureMutex, stream::Stream}; |
3099 | + |
3100 | + use crate::{ |
3101 | + backends::*, |
3102 | + conf::AccountSettings, |
3103 | + connections::timeout, |
3104 | + email::*, |
3105 | + error::{Error, Result, ResultIntoError}, |
3106 | + Collection, |
3107 | + }; |
3108 | pub type UID = usize; |
3109 | |
3110 | macro_rules! get_conf_val { |
3111 | @@ -253,9 +258,21 @@ impl MailBackend for NntpType { |
3112 | let uid_store = self.uid_store.clone(); |
3113 | let connection = self.connection.clone(); |
3114 | Ok(Box::pin(async move { |
3115 | - /* To get updates, either issue NEWNEWS if it's supported by the server, and fallback |
3116 | - * to OVER otherwise */ |
3117 | - let mbox: NntpMailbox = uid_store.mailboxes.lock().await.get(&mailbox_hash).map(std::clone::Clone::clone).ok_or_else(|| Error::new(format!("Mailbox with hash {} not found in NNTP connection, this could possibly be a bug or it was deleted.", mailbox_hash)))?; |
3118 | + /* To get updates, either issue NEWNEWS if it's supported by the server, and |
3119 | + * fallback to OVER otherwise */ |
3120 | + let mbox: NntpMailbox = uid_store |
3121 | + .mailboxes |
3122 | + .lock() |
3123 | + .await |
3124 | + .get(&mailbox_hash) |
3125 | + .map(std::clone::Clone::clone) |
3126 | + .ok_or_else(|| { |
3127 | + Error::new(format!( |
3128 | + "Mailbox with hash {} not found in NNTP connection, this could possibly \ |
3129 | + be a bug or it was deleted.", |
3130 | + mailbox_hash |
3131 | + )) |
3132 | + })?; |
3133 | let latest_article: Option<crate::UnixTimestamp> = *mbox.latest_article.lock().unwrap(); |
3134 | let (over_msgid_support, newnews_support): (bool, bool) = { |
3135 | let caps = uid_store.capabilities.lock().unwrap(); |
3136 | @@ -374,15 +391,15 @@ impl MailBackend for NntpType { |
3137 | } |
3138 | |
3139 | fn operation(&self, env_hash: EnvelopeHash) -> Result<Box<dyn BackendOp>> { |
3140 | - let (uid, mailbox_hash) = if let Some(v) = |
3141 | - self.uid_store.hash_index.lock().unwrap().get(&env_hash) |
3142 | - { |
3143 | - *v |
3144 | - } else { |
3145 | - return Err(Error::new( |
3146 | - "Message not found in local cache, it might have been deleted before you requested it." |
3147 | + let (uid, mailbox_hash) = |
3148 | + if let Some(v) = self.uid_store.hash_index.lock().unwrap().get(&env_hash) { |
3149 | + *v |
3150 | + } else { |
3151 | + return Err(Error::new( |
3152 | + "Message not found in local cache, it might have been deleted before you \ |
3153 | + requested it.", |
3154 | )); |
3155 | - }; |
3156 | + }; |
3157 | Ok(Box::new(NntpOp::new( |
3158 | uid, |
3159 | mailbox_hash, |
3160 | @@ -671,34 +688,35 @@ impl NntpType { |
3161 | pub fn validate_config(s: &mut AccountSettings) -> Result<()> { |
3162 | let mut keys: HashSet<&'static str> = Default::default(); |
3163 | macro_rules! get_conf_val { |
3164 | - ($s:ident[$var:literal]) => {{ |
3165 | - keys.insert($var); |
3166 | - $s.extra.remove($var).ok_or_else(|| { |
3167 | - Error::new(format!( |
3168 | - "Configuration error ({}): NNTP connection requires the field `{}` set", |
3169 | - $s.name.as_str(), |
3170 | - $var |
3171 | - )) |
3172 | - }) |
3173 | - }}; |
3174 | - ($s:ident[$var:literal], $default:expr) => {{ |
3175 | - keys.insert($var); |
3176 | - $s.extra |
3177 | - .remove($var) |
3178 | - .map(|v| { |
3179 | - <_>::from_str(&v).map_err(|e| { |
3180 | + ($s:ident[$var:literal]) => {{ |
3181 | + keys.insert($var); |
3182 | + $s.extra.remove($var).ok_or_else(|| { |
3183 | Error::new(format!( |
3184 | - "Configuration error ({}) NNTP: Invalid value for field `{}`: {}\n{}", |
3185 | + "Configuration error ({}): NNTP connection requires the field `{}` set", |
3186 | $s.name.as_str(), |
3187 | - $var, |
3188 | - v, |
3189 | - e |
3190 | + $var |
3191 | )) |
3192 | }) |
3193 | - }) |
3194 | - .unwrap_or_else(|| Ok($default)) |
3195 | - }}; |
3196 | - } |
3197 | + }}; |
3198 | + ($s:ident[$var:literal], $default:expr) => {{ |
3199 | + keys.insert($var); |
3200 | + $s.extra |
3201 | + .remove($var) |
3202 | + .map(|v| { |
3203 | + <_>::from_str(&v).map_err(|e| { |
3204 | + Error::new(format!( |
3205 | + "Configuration error ({}) NNTP: Invalid value for field `{}`: \ |
3206 | + {}\n{}", |
3207 | + $s.name.as_str(), |
3208 | + $var, |
3209 | + v, |
3210 | + e |
3211 | + )) |
3212 | + }) |
3213 | + }) |
3214 | + .unwrap_or_else(|| Ok($default)) |
3215 | + }}; |
3216 | + } |
3217 | get_conf_val!(s["require_auth"], false)?; |
3218 | get_conf_val!(s["server_hostname"])?; |
3219 | get_conf_val!(s["server_username"], String::new())?; |
3220 | @@ -706,7 +724,8 @@ impl NntpType { |
3221 | get_conf_val!(s["server_password"], String::new())?; |
3222 | } else if s.extra.contains_key("server_password") { |
3223 | return Err(Error::new(format!( |
3224 | - "Configuration error ({}): both server_password and server_password_command are set, cannot choose", |
3225 | + "Configuration error ({}): both server_password and server_password_command are \ |
3226 | + set, cannot choose", |
3227 | s.name.as_str(), |
3228 | ))); |
3229 | } |
3230 | @@ -716,7 +735,8 @@ impl NntpType { |
3231 | let use_starttls = get_conf_val!(s["use_starttls"], server_port != 563)?; |
3232 | if !use_tls && use_starttls { |
3233 | return Err(Error::new(format!( |
3234 | - "Configuration error ({}): incompatible use_tls and use_starttls values: use_tls = false, use_starttls = true", |
3235 | + "Configuration error ({}): incompatible use_tls and use_starttls values: use_tls \ |
3236 | + = false, use_starttls = true", |
3237 | s.name.as_str(), |
3238 | ))); |
3239 | } |
3240 | @@ -725,7 +745,8 @@ impl NntpType { |
3241 | #[cfg(not(feature = "deflate_compression"))] |
3242 | if s.extra.contains_key("use_deflate") { |
3243 | return Err(Error::new(format!( |
3244 | - "Configuration error ({}): setting `use_deflate` is set but this version of meli isn't compiled with DEFLATE support.", |
3245 | + "Configuration error ({}): setting `use_deflate` is set but this version of meli \ |
3246 | + isn't compiled with DEFLATE support.", |
3247 | s.name.as_str(), |
3248 | ))); |
3249 | } |
3250 | @@ -738,8 +759,10 @@ impl NntpType { |
3251 | let diff = extra_keys.difference(&keys).collect::<Vec<&&str>>(); |
3252 | if !diff.is_empty() { |
3253 | return Err(Error::new(format!( |
3254 | - "Configuration error ({}) NNTP: the following flags are set but are not recognized: {:?}.", |
3255 | - s.name.as_str(), diff |
3256 | + "Configuration error ({}) NNTP: the following flags are set but are not \ |
3257 | + recognized: {:?}.", |
3258 | + s.name.as_str(), |
3259 | + diff |
3260 | ))); |
3261 | } |
3262 | Ok(()) |
3263 | diff --git a/melib/src/backends/nntp/connection.rs b/melib/src/backends/nntp/connection.rs |
3264 | index 21d10fd..6eafefe 100644 |
3265 | --- a/melib/src/backends/nntp/connection.rs |
3266 | +++ b/melib/src/backends/nntp/connection.rs |
3267 | @@ -19,19 +19,18 @@ |
3268 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3269 | */ |
3270 | |
3271 | - use crate::backends::{BackendMailbox, MailboxHash}; |
3272 | - use crate::connections::{lookup_ipv4, Connection}; |
3273 | - use crate::email::parser::BytesExt; |
3274 | - use crate::error::*; |
3275 | + use crate::{ |
3276 | + backends::{BackendMailbox, MailboxHash}, |
3277 | + connections::{lookup_ipv4, Connection}, |
3278 | + email::parser::BytesExt, |
3279 | + error::*, |
3280 | + }; |
3281 | extern crate native_tls; |
3282 | + use std::{collections::HashSet, future::Future, pin::Pin, sync::Arc, time::Instant}; |
3283 | + |
3284 | use futures::io::{AsyncReadExt, AsyncWriteExt}; |
3285 | use native_tls::TlsConnector; |
3286 | pub use smol::Async as AsyncWrapper; |
3287 | - use std::collections::HashSet; |
3288 | - use std::future::Future; |
3289 | - use std::pin::Pin; |
3290 | - use std::sync::Arc; |
3291 | - use std::time::Instant; |
3292 | |
3293 | use super::{Capabilities, NntpServerConf, UIDStore}; |
3294 | |
3295 | diff --git a/melib/src/backends/nntp/mailbox.rs b/melib/src/backends/nntp/mailbox.rs |
3296 | index 67b976e..7cb0d08 100644 |
3297 | --- a/melib/src/backends/nntp/mailbox.rs |
3298 | +++ b/melib/src/backends/nntp/mailbox.rs |
3299 | @@ -19,13 +19,16 @@ |
3300 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3301 | */ |
3302 | |
3303 | - use crate::backends::{ |
3304 | - BackendMailbox, LazyCountSet, Mailbox, MailboxHash, MailboxPermissions, SpecialUsageMailbox, |
3305 | - }; |
3306 | - use crate::error::*; |
3307 | - use crate::UnixTimestamp; |
3308 | use std::sync::{Arc, Mutex}; |
3309 | |
3310 | + use crate::{ |
3311 | + backends::{ |
3312 | + BackendMailbox, LazyCountSet, Mailbox, MailboxHash, MailboxPermissions, SpecialUsageMailbox, |
3313 | + }, |
3314 | + error::*, |
3315 | + UnixTimestamp, |
3316 | + }; |
3317 | + |
3318 | #[derive(Debug, Default, Clone)] |
3319 | pub struct NntpMailbox { |
3320 | pub(super) hash: MailboxHash, |
3321 | diff --git a/melib/src/backends/nntp/operations.rs b/melib/src/backends/nntp/operations.rs |
3322 | index 6bff363..6ea5e6b 100644 |
3323 | --- a/melib/src/backends/nntp/operations.rs |
3324 | +++ b/melib/src/backends/nntp/operations.rs |
3325 | @@ -19,13 +19,11 @@ |
3326 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3327 | */ |
3328 | |
3329 | - use super::*; |
3330 | - |
3331 | - use crate::backends::*; |
3332 | - use crate::email::*; |
3333 | - use crate::error::Error; |
3334 | use std::sync::Arc; |
3335 | |
3336 | + use super::*; |
3337 | + use crate::{backends::*, email::*, error::Error}; |
3338 | + |
3339 | /// `BackendOp` implementor for Nntp |
3340 | #[derive(Debug, Clone)] |
3341 | pub struct NntpOp { |
3342 | diff --git a/melib/src/backends/nntp/protocol_parser.rs b/melib/src/backends/nntp/protocol_parser.rs |
3343 | index 2501288..1f61929 100644 |
3344 | --- a/melib/src/backends/nntp/protocol_parser.rs |
3345 | +++ b/melib/src/backends/nntp/protocol_parser.rs |
3346 | @@ -19,13 +19,15 @@ |
3347 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3348 | */ |
3349 | |
3350 | - use super::*; |
3351 | - use crate::email::parser::IResult; |
3352 | + use std::str::FromStr; |
3353 | + |
3354 | use nom::{ |
3355 | bytes::complete::{is_not, tag}, |
3356 | combinator::opt, |
3357 | }; |
3358 | - use std::str::FromStr; |
3359 | + |
3360 | + use super::*; |
3361 | + use crate::email::parser::IResult; |
3362 | |
3363 | pub struct NntpLineIterator<'a> { |
3364 | slice: &'a str, |
3365 | diff --git a/melib/src/backends/notmuch.rs b/melib/src/backends/notmuch.rs |
3366 | index 8c7cca0..4a582cc 100644 |
3367 | --- a/melib/src/backends/notmuch.rs |
3368 | +++ b/melib/src/backends/notmuch.rs |
3369 | @@ -19,18 +19,25 @@ |
3370 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3371 | */ |
3372 | |
3373 | - use crate::conf::AccountSettings; |
3374 | - use crate::email::{Envelope, EnvelopeHash, Flag}; |
3375 | - use crate::error::{Error, Result}; |
3376 | - use crate::shellexpand::ShellExpandTrait; |
3377 | - use crate::{backends::*, Collection}; |
3378 | + use std::{ |
3379 | + collections::{hash_map::HashMap, BTreeMap}, |
3380 | + ffi::{CStr, CString, OsStr}, |
3381 | + io::Read, |
3382 | + os::unix::ffi::OsStrExt, |
3383 | + path::{Path, PathBuf}, |
3384 | + sync::{Arc, Mutex, RwLock}, |
3385 | + }; |
3386 | + |
3387 | use smallvec::SmallVec; |
3388 | - use std::collections::{hash_map::HashMap, BTreeMap}; |
3389 | - use std::ffi::{CStr, CString, OsStr}; |
3390 | - use std::io::Read; |
3391 | - use std::os::unix::ffi::OsStrExt; |
3392 | - use std::path::{Path, PathBuf}; |
3393 | - use std::sync::{Arc, Mutex, RwLock}; |
3394 | + |
3395 | + use crate::{ |
3396 | + backends::*, |
3397 | + conf::AccountSettings, |
3398 | + email::{Envelope, EnvelopeHash, Flag}, |
3399 | + error::{Error, Result}, |
3400 | + shellexpand::ShellExpandTrait, |
3401 | + Collection, |
3402 | + }; |
3403 | |
3404 | macro_rules! call { |
3405 | ($lib:expr, $func:ty) => {{ |
3406 | @@ -316,9 +323,14 @@ impl NotmuchDb { |
3407 | Ok(l) => l, |
3408 | Err(err) => { |
3409 | if custom_dlpath { |
3410 | - return Err(Error::new(format!("Notmuch `library_file_path` setting value `{}` for account {} does not exist or is a directory or not a valid library file.",dlpath, s.name())) |
3411 | - .set_kind(ErrorKind::Configuration) |
3412 | - .set_source(Some(Arc::new(err)))); |
3413 | + return Err(Error::new(format!( |
3414 | + "Notmuch `library_file_path` setting value `{}` for account {} does \ |
3415 | + not exist or is a directory or not a valid library file.", |
3416 | + dlpath, |
3417 | + s.name() |
3418 | + )) |
3419 | + .set_kind(ErrorKind::Configuration) |
3420 | + .set_source(Some(Arc::new(err)))); |
3421 | } else { |
3422 | return Err(Error::new("Could not load libnotmuch!") |
3423 | .set_details(super::NOTMUCH_ERROR_DETAILS) |
3424 | @@ -347,10 +359,12 @@ impl NotmuchDb { |
3425 | path.push(".notmuch"); |
3426 | if !path.exists() || !path.is_dir() { |
3427 | return Err(Error::new(format!( |
3428 | - "Notmuch `root_mailbox` {} for account {} does not contain a `.notmuch` subdirectory.", |
3429 | + "Notmuch `root_mailbox` {} for account {} does not contain a `.notmuch` \ |
3430 | + subdirectory.", |
3431 | s.root_mailbox.as_str(), |
3432 | s.name() |
3433 | - )).set_kind(ErrorKind::Configuration)); |
3434 | + )) |
3435 | + .set_kind(ErrorKind::Configuration)); |
3436 | } |
3437 | path.pop(); |
3438 | |
3439 | @@ -378,7 +392,8 @@ impl NotmuchDb { |
3440 | ); |
3441 | } else { |
3442 | return Err(Error::new(format!( |
3443 | - "notmuch mailbox configuration entry `{}` for account {} should have a `query` value set.", |
3444 | + "notmuch mailbox configuration entry `{}` for account {} should have a \ |
3445 | + `query` value set.", |
3446 | k, |
3447 | s.name(), |
3448 | )) |
3449 | @@ -399,7 +414,8 @@ impl NotmuchDb { |
3450 | mailboxes.entry(hash).or_default().parent = Some(parent_hash); |
3451 | } else { |
3452 | return Err(Error::new(format!( |
3453 | - "Mailbox configuration for `{}` defines its parent mailbox as `{}` but no mailbox exists with this exact name.", |
3454 | + "Mailbox configuration for `{}` defines its parent mailbox as `{}` but no \ |
3455 | + mailbox exists with this exact name.", |
3456 | mailboxes[&hash].name(), |
3457 | parent |
3458 | )) |
3459 | @@ -445,10 +461,12 @@ impl NotmuchDb { |
3460 | path.push(".notmuch"); |
3461 | if !path.exists() || !path.is_dir() { |
3462 | return Err(Error::new(format!( |
3463 | - "Notmuch `root_mailbox` {} for account {} does not contain a `.notmuch` subdirectory.", |
3464 | + "Notmuch `root_mailbox` {} for account {} does not contain a `.notmuch` \ |
3465 | + subdirectory.", |
3466 | s.root_mailbox.as_str(), |
3467 | s.name() |
3468 | - )).set_kind(ErrorKind::Configuration)); |
3469 | + )) |
3470 | + .set_kind(ErrorKind::Configuration)); |
3471 | } |
3472 | path.pop(); |
3473 | |
3474 | @@ -456,19 +474,21 @@ impl NotmuchDb { |
3475 | if let Some(lib_path) = s.extra.remove("library_file_path") { |
3476 | if !Path::new(&lib_path).exists() || Path::new(&lib_path).is_dir() { |
3477 | return Err(Error::new(format!( |
3478 | - "Notmuch `library_file_path` setting value `{}` for account {} does not exist or is a directory.", |
3479 | - &lib_path, |
3480 | - s.name() |
3481 | - )).set_kind(ErrorKind::Configuration)); |
3482 | + "Notmuch `library_file_path` setting value `{}` for account {} does not exist \ |
3483 | + or is a directory.", |
3484 | + &lib_path, |
3485 | + s.name() |
3486 | + )) |
3487 | + .set_kind(ErrorKind::Configuration)); |
3488 | } |
3489 | } |
3490 | let mut parents: Vec<(String, String)> = Vec::with_capacity(s.mailboxes.len()); |
3491 | for (k, f) in s.mailboxes.iter_mut() { |
3492 | if f.extra.remove("query").is_none() { |
3493 | return Err(Error::new(format!( |
3494 | - "notmuch mailbox configuration entry `{}` for account {} should have a `query` value set.", |
3495 | - k, |
3496 | - account_name, |
3497 | + "notmuch mailbox configuration entry `{}` for account {} should have a \ |
3498 | + `query` value set.", |
3499 | + k, account_name, |
3500 | )) |
3501 | .set_kind(ErrorKind::Configuration)); |
3502 | } |
3503 | @@ -480,9 +500,9 @@ impl NotmuchDb { |
3504 | for (mbox, parent) in parents.iter() { |
3505 | if !s.mailboxes.contains_key(parent) { |
3506 | return Err(Error::new(format!( |
3507 | - "Mailbox configuration for `{}` defines its parent mailbox as `{}` but no mailbox exists with this exact name.", |
3508 | - mbox, |
3509 | - parent |
3510 | + "Mailbox configuration for `{}` defines its parent mailbox as `{}` but no \ |
3511 | + mailbox exists with this exact name.", |
3512 | + mbox, parent |
3513 | )) |
3514 | .set_kind(ErrorKind::Configuration)); |
3515 | } |
3516 | diff --git a/melib/src/backends/notmuch/bindings.rs b/melib/src/backends/notmuch/bindings.rs |
3517 | index 8841e97..acb4257 100644 |
3518 | --- a/melib/src/backends/notmuch/bindings.rs |
3519 | +++ b/melib/src/backends/notmuch/bindings.rs |
3520 | @@ -244,7 +244,6 @@ pub type notmuch_database_open_verbose = unsafe extern "C" fn( |
3521 | ) -> notmuch_status_t; |
3522 | |
3523 | /// Retrieve last status string for given database. |
3524 | - /// |
3525 | pub type notmuch_database_status_string = |
3526 | unsafe extern "C" fn(notmuch: *const notmuch_database_t) -> *const ::std::os::raw::c_char; |
3527 | |
3528 | @@ -509,7 +508,6 @@ extern "C" { |
3529 | /// @deprecated Deprecated as of libnotmuch 5.1 (notmuch 0.26). Please |
3530 | /// use notmuch_database_index_file instead. |
3531 | /// ``` |
3532 | - /// |
3533 | pub fn notmuch_database_add_message( |
3534 | database: *mut notmuch_database_t, |
3535 | filename: *const ::std::os::raw::c_char, |
3536 | @@ -751,7 +749,7 @@ pub type notmuch_query_add_tag_exclude = unsafe extern "C" fn( |
3537 | /// } |
3538 | /// |
3539 | /// notmuch_query_destroy (query); |
3540 | - ///``` |
3541 | + /// ``` |
3542 | /// |
3543 | /// Note: If you are finished with a thread before its containing |
3544 | /// query, you can call notmuch_thread_destroy to clean up some memory |
3545 | @@ -779,7 +777,6 @@ pub type notmuch_query_search_threads = unsafe extern "C" fn( |
3546 | /// @deprecated Deprecated as of libnotmuch 5 (notmuch 0.25). Please |
3547 | /// ``` |
3548 | /// use notmuch_query_search_threads instead. |
3549 | - /// |
3550 | pub type notmuch_query_search_threads_st = unsafe extern "C" fn( |
3551 | query: *mut notmuch_query_t, |
3552 | out: *mut *mut notmuch_threads_t, |
3553 | @@ -809,7 +806,7 @@ pub type notmuch_query_search_threads_st = unsafe extern "C" fn( |
3554 | /// } |
3555 | /// |
3556 | /// notmuch_query_destroy (query); |
3557 | - ///``` |
3558 | + /// ``` |
3559 | /// |
3560 | /// Note: If you are finished with a message before its containing |
3561 | /// query, you can call notmuch_message_destroy to clean up some memory |
3562 | @@ -839,7 +836,6 @@ pub type notmuch_query_search_messages = unsafe extern "C" fn( |
3563 | /// @deprecated Deprecated as of libnotmuch 5 (notmuch 0.25). Please use |
3564 | /// ``` |
3565 | /// notmuch_query_search_messages instead. |
3566 | - /// |
3567 | pub type notmuch_query_search_messages_st = unsafe extern "C" fn( |
3568 | query: *mut notmuch_query_t, |
3569 | out: *mut *mut notmuch_messages_t, |
3570 | @@ -1091,7 +1087,7 @@ pub type notmuch_thread_get_newest_date = |
3571 | /// } |
3572 | /// |
3573 | /// notmuch_thread_destroy (thread); |
3574 | - ///``` |
3575 | + /// ``` |
3576 | /// |
3577 | /// Note that there's no explicit destructor needed for the |
3578 | /// notmuch_tags_t object. (For consistency, we do provide a |
3579 | @@ -1250,7 +1246,8 @@ pub type notmuch_message_get_filename = |
3580 | pub type notmuch_message_get_filenames = |
3581 | unsafe extern "C" fn(message: *mut notmuch_message_t) -> *mut notmuch_filenames_t; |
3582 | |
3583 | - /// Re-index the e-mail corresponding to 'message' using the supplied index options |
3584 | + /// Re-index the e-mail corresponding to 'message' using the supplied index |
3585 | + /// options |
3586 | /// |
3587 | /// Returns the status of the re-index operation. (see the return |
3588 | /// codes documented in notmuch_database_index_file) |
3589 | @@ -1333,7 +1330,7 @@ pub type notmuch_message_get_header = unsafe extern "C" fn( |
3590 | /// } |
3591 | /// |
3592 | /// notmuch_message_destroy (message); |
3593 | - ///``` |
3594 | + /// ``` |
3595 | /// |
3596 | /// Note that there's no explicit destructor needed for the |
3597 | /// notmuch_tags_t object. (For consistency, we do provide a |
3598 | @@ -1423,7 +1420,6 @@ pub type notmuch_message_maildir_flags_to_tags = |
3599 | |
3600 | /// return TRUE if any filename of 'message' has maildir flag 'flag', |
3601 | /// FALSE otherwise. |
3602 | - /// |
3603 | pub type notmuch_message_has_maildir_flag = unsafe extern "C" fn( |
3604 | message: *mut notmuch_message_t, |
3605 | flag: ::std::os::raw::c_char, |
3606 | @@ -1673,7 +1669,7 @@ extern "C" { |
3607 | /// } |
3608 | /// |
3609 | /// notmuch_message_properties_destroy (list); |
3610 | - ///``` |
3611 | + /// ``` |
3612 | /// |
3613 | /// Note that there's no explicit destructor needed for the |
3614 | /// notmuch_message_properties_t object. (For consistency, we do |
3615 | @@ -1689,7 +1685,8 @@ extern "C" { |
3616 | exact: notmuch_bool_t, |
3617 | ) -> *mut notmuch_message_properties_t; |
3618 | } |
3619 | - /// Return the number of properties named "key" belonging to the specific message. |
3620 | + /// Return the number of properties named "key" belonging to the specific |
3621 | + /// message. |
3622 | /// |
3623 | /// ```text |
3624 | /// @param[in] message The message to examine |
3625 | @@ -1970,7 +1967,8 @@ pub type notmuch_database_get_config_list = unsafe extern "C" fn( |
3626 | out: *mut *mut notmuch_config_list_t, |
3627 | ) -> notmuch_status_t; |
3628 | |
3629 | - /// Is 'config_list' iterator valid (i.e. _key, _value, _move_to_next can be called). |
3630 | + /// Is 'config_list' iterator valid (i.e. _key, _value, _move_to_next can be |
3631 | + /// called). |
3632 | /// |
3633 | /// ```text |
3634 | /// @since libnotmuch 4.4 (notmuch 0.23) |
3635 | diff --git a/melib/src/backends/utf7.rs b/melib/src/backends/utf7.rs |
3636 | index 12218d8..d8ef008 100644 |
3637 | --- a/melib/src/backends/utf7.rs |
3638 | +++ b/melib/src/backends/utf7.rs |
3639 | @@ -3,23 +3,23 @@ |
3640 | * |
3641 | * Copyright (c) 2021 Ilya Medvedev |
3642 | * |
3643 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
3644 | - * of this software and associated documentation files (the "Software"), to deal |
3645 | - * in the Software without restriction, including without limitation the rights |
3646 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
3647 | - * copies of the Software, and to permit persons to whom the Software is |
3648 | - * furnished to do so, subject to the following conditions: |
3649 | + * Permission is hereby granted, free of charge, to any person obtaining a |
3650 | + * copy of this software and associated documentation files (the "Software"), |
3651 | + * to deal in the Software without restriction, including without limitation |
3652 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
3653 | + * and/or sell copies of the Software, and to permit persons to whom the |
3654 | + * Software is furnished to do so, subject to the following conditions: |
3655 | * |
3656 | - * The above copyright notice and this permission notice shall be included in all |
3657 | - * copies or substantial portions of the Software. |
3658 | + * The above copyright notice and this permission notice shall be included in |
3659 | + * all copies or substantial portions of the Software. |
3660 | * |
3661 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
3662 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
3663 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
3664 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3665 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
3666 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
3667 | - * SOFTWARE. |
3668 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
3669 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3670 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
3671 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
3672 | + * DEALINGS IN THE SOFTWARE. |
3673 | */ |
3674 | |
3675 | /* Code from <https://github.com/iam-medvedev/rust-utf7-imap> */ |
3676 | @@ -111,7 +111,7 @@ fn encode_modified_utf7(text: &str) -> String { |
3677 | /// <https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3> |
3678 | pub fn decode_utf7_imap(text: &str) -> String { |
3679 | let pattern = Regex::new(r"&([^-]*)-").unwrap(); |
3680 | - pattern.replace_all(&text, expand).to_string() |
3681 | + pattern.replace_all(text, expand).to_string() |
3682 | } |
3683 | |
3684 | fn expand(cap: &Captures) -> String { |
3685 | diff --git a/melib/src/collection.rs b/melib/src/collection.rs |
3686 | index 7320ab6..3fed758 100644 |
3687 | --- a/melib/src/collection.rs |
3688 | +++ b/melib/src/collection.rs |
3689 | @@ -19,13 +19,16 @@ |
3690 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3691 | */ |
3692 | |
3693 | - use super::*; |
3694 | - use crate::backends::{MailboxHash, TagHash}; |
3695 | + use std::{ |
3696 | + collections::{BTreeMap, HashMap, HashSet}, |
3697 | + ops::{Deref, DerefMut}, |
3698 | + sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard}, |
3699 | + }; |
3700 | + |
3701 | use smallvec::SmallVec; |
3702 | - use std::ops::{Deref, DerefMut}; |
3703 | - use std::sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard}; |
3704 | |
3705 | - use std::collections::{BTreeMap, HashMap, HashSet}; |
3706 | + use super::*; |
3707 | + use crate::backends::{MailboxHash, TagHash}; |
3708 | |
3709 | pub type EnvelopeRef<'g> = RwRef<'g, EnvelopeHash, Envelope>; |
3710 | pub type EnvelopeRefMut<'g> = RwRefMut<'g, EnvelopeHash, Envelope>; |
3711 | diff --git a/melib/src/conf.rs b/melib/src/conf.rs |
3712 | index 9f7c1f4..ae182b7 100644 |
3713 | --- a/melib/src/conf.rs |
3714 | +++ b/melib/src/conf.rs |
3715 | @@ -19,13 +19,18 @@ |
3716 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3717 | */ |
3718 | |
3719 | - //! Basic mail account configuration to use with [`backends`](./backends/index.html) |
3720 | - use crate::backends::SpecialUsageMailbox; |
3721 | - use crate::error::{Error, Result}; |
3722 | - pub use crate::{SortField, SortOrder}; |
3723 | - use serde::{Deserialize, Deserializer, Serialize, Serializer}; |
3724 | + //! Basic mail account configuration to use with |
3725 | + //! [`backends`](./backends/index.html) |
3726 | use std::collections::HashMap; |
3727 | |
3728 | + use serde::{Deserialize, Deserializer, Serialize, Serializer}; |
3729 | + |
3730 | + use crate::{ |
3731 | + backends::SpecialUsageMailbox, |
3732 | + error::{Error, Result}, |
3733 | + }; |
3734 | + pub use crate::{SortField, SortOrder}; |
3735 | + |
3736 | #[derive(Debug, Serialize, Default, Clone)] |
3737 | pub struct AccountSettings { |
3738 | pub name: String, |
3739 | @@ -87,7 +92,7 @@ impl AccountSettings { |
3740 | pub fn server_password(&self) -> Result<String> { |
3741 | if let Some(cmd) = self.extra.get("server_password_command") { |
3742 | let output = std::process::Command::new("sh") |
3743 | - .args(&["-c", cmd]) |
3744 | + .args(["-c", cmd]) |
3745 | .stdin(std::process::Stdio::piped()) |
3746 | .stdout(std::process::Stdio::piped()) |
3747 | .stderr(std::process::Stdio::piped()) |
3748 | @@ -107,7 +112,10 @@ impl AccountSettings { |
3749 | } else if let Some(pass) = self.extra.get("server_password") { |
3750 | Ok(pass.to_owned()) |
3751 | } else { |
3752 | - Err(Error::new(format!("Configuration error: connection requires either server_password or server_password_command"))) |
3753 | + Err(Error::new(format!( |
3754 | + "Configuration error: connection requires either server_password or \ |
3755 | + server_password_command" |
3756 | + ))) |
3757 | } |
3758 | } |
3759 | } |
3760 | diff --git a/melib/src/connections.rs b/melib/src/connections.rs |
3761 | index 5db98c9..f7674a3 100644 |
3762 | --- a/melib/src/connections.rs |
3763 | +++ b/melib/src/connections.rs |
3764 | @@ -20,6 +20,8 @@ |
3765 | */ |
3766 | |
3767 | //! Connections layers (TCP/fd/TLS/Deflate) to use with remote backends. |
3768 | + use std::{os::unix::io::AsRawFd, time::Duration}; |
3769 | + |
3770 | #[cfg(feature = "deflate_compression")] |
3771 | use flate2::{read::DeflateDecoder, write::DeflateEncoder, Compression}; |
3772 | #[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "haiku"))] |
3773 | @@ -35,8 +37,6 @@ use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION; |
3774 | )))] |
3775 | use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION; |
3776 | use libc::{self, c_int, c_void}; |
3777 | - use std::os::unix::io::AsRawFd; |
3778 | - use std::time::Duration; |
3779 | |
3780 | #[derive(Debug)] |
3781 | pub enum Connection { |
3782 | diff --git a/melib/src/datetime.rs b/melib/src/datetime.rs |
3783 | index 73a3ae9..3084bae 100644 |
3784 | --- a/melib/src/datetime.rs |
3785 | +++ b/melib/src/datetime.rs |
3786 | @@ -37,11 +37,14 @@ |
3787 | //! let s = timestamp_to_string(timestamp, Some("%Y-%m-%d"), true); |
3788 | //! assert_eq!(s, "2020-01-08"); |
3789 | //! ``` |
3790 | + use std::{ |
3791 | + borrow::Cow, |
3792 | + convert::TryInto, |
3793 | + ffi::{CStr, CString}, |
3794 | + os::raw::c_int, |
3795 | + }; |
3796 | + |
3797 | use crate::error::{Result, ResultIntoError}; |
3798 | - use std::borrow::Cow; |
3799 | - use std::convert::TryInto; |
3800 | - use std::ffi::{CStr, CString}; |
3801 | - use std::os::raw::c_int; |
3802 | |
3803 | pub type UnixTimestamp = u64; |
3804 | pub const RFC3339_FMT_WITH_TIME: &str = "%Y-%m-%dT%H:%M:%S\0"; |
3805 | @@ -122,7 +125,8 @@ impl Drop for Locale { |
3806 | } |
3807 | } |
3808 | |
3809 | - // How to unit test this? Test machine is not guaranteed to have non-english locales. |
3810 | + // How to unit test this? Test machine is not guaranteed to have non-english |
3811 | + // locales. |
3812 | impl Locale { |
3813 | #[cfg(not(target_os = "netbsd"))] |
3814 | fn new( |
3815 | diff --git a/melib/src/email.rs b/melib/src/email.rs |
3816 | index 23b2d8d..37a6554 100644 |
3817 | --- a/melib/src/email.rs |
3818 | +++ b/melib/src/email.rs |
3819 | @@ -24,8 +24,9 @@ |
3820 | * |
3821 | * # Parsing bytes into an `Envelope` |
3822 | * |
3823 | - * An [`Envelope`](Envelope) represents the information you can get from an email's headers and body |
3824 | - * structure. Addresses in `To`, `From` fields etc are parsed into [`Address`](crate::email::Address) types. |
3825 | + * An [`Envelope`](Envelope) represents the information you can get from an |
3826 | + * email's headers and body structure. Addresses in `To`, `From` fields etc |
3827 | + * are parsed into [`Address`](crate::email::Address) types. |
3828 | * |
3829 | * ``` |
3830 | * use melib::{Attachment, Envelope}; |
3831 | @@ -75,7 +76,10 @@ |
3832 | * |
3833 | * let envelope = Envelope::from_bytes(raw_mail.as_bytes(), None).expect("Could not parse mail"); |
3834 | * assert_eq!(envelope.subject().as_ref(), "gratuitously encoded subject"); |
3835 | - * assert_eq!(envelope.message_id_display().as_ref(), "<h2g7f.z0gy2pgaen5m@example.com>"); |
3836 | + * assert_eq!( |
3837 | + * envelope.message_id_display().as_ref(), |
3838 | + * "<h2g7f.z0gy2pgaen5m@example.com>" |
3839 | + * ); |
3840 | * |
3841 | * let body = envelope.body_bytes(raw_mail.as_bytes()); |
3842 | * assert_eq!(body.content_type().to_string().as_str(), "multipart/mixed"); |
3843 | @@ -85,7 +89,10 @@ |
3844 | * |
3845 | * let subattachments: Vec<Attachment> = body.attachments(); |
3846 | * assert_eq!(subattachments.len(), 3); |
3847 | - * assert_eq!(subattachments[2].content_type().name().unwrap(), "test_image.gif"); |
3848 | + * assert_eq!( |
3849 | + * subattachments[2].content_type().name().unwrap(), |
3850 | + * "test_image.gif" |
3851 | + * ); |
3852 | * ``` |
3853 | */ |
3854 | |
3855 | @@ -99,22 +106,22 @@ pub mod mailto; |
3856 | pub mod parser; |
3857 | pub mod pgp; |
3858 | |
3859 | + use std::{borrow::Cow, convert::TryInto, ops::Deref}; |
3860 | + |
3861 | pub use address::{Address, MessageID, References, StrBuild, StrBuilder}; |
3862 | pub use attachments::{Attachment, AttachmentBuilder}; |
3863 | pub use compose::{attachment_from_file, Draft}; |
3864 | pub use headers::*; |
3865 | pub use mailto::*; |
3866 | - |
3867 | - use crate::datetime::UnixTimestamp; |
3868 | - use crate::error::{Error, Result}; |
3869 | - use crate::parser::BytesExt; |
3870 | - use crate::thread::ThreadNodeHash; |
3871 | - use crate::TagHash; |
3872 | - |
3873 | use smallvec::SmallVec; |
3874 | - use std::borrow::Cow; |
3875 | - use std::convert::TryInto; |
3876 | - use std::ops::Deref; |
3877 | + |
3878 | + use crate::{ |
3879 | + datetime::UnixTimestamp, |
3880 | + error::{Error, Result}, |
3881 | + parser::BytesExt, |
3882 | + thread::ThreadNodeHash, |
3883 | + TagHash, |
3884 | + }; |
3885 | |
3886 | bitflags! { |
3887 | #[derive(Default, Serialize, Deserialize)] |
3888 | @@ -159,9 +166,10 @@ impl Flag { |
3889 | flag_impl!(fn is_flagged, Flag::FLAGGED); |
3890 | } |
3891 | |
3892 | - ///`Mail` holds both the envelope info of an email in its `envelope` field and the raw bytes that |
3893 | - ///describe the email in `bytes`. Its body as an `melib::email::Attachment` can be parsed on demand |
3894 | - ///with the `melib::email::Mail::body` method. |
3895 | + ///`Mail` holds both the envelope info of an email in its `envelope` field and |
3896 | + /// the raw bytes that describe the email in `bytes`. Its body as an |
3897 | + /// `melib::email::Attachment` can be parsed on demand |
3898 | + /// with the `melib::email::Mail::body` method. |
3899 | #[derive(Debug, Clone, Default)] |
3900 | pub struct Mail { |
3901 | pub envelope: Envelope, |
3902 | @@ -199,12 +207,13 @@ impl Mail { |
3903 | |
3904 | crate::declare_u64_hash!(EnvelopeHash); |
3905 | |
3906 | - /// `Envelope` represents all the header and structure data of an email we need to know. |
3907 | + /// `Envelope` represents all the header and structure data of an email we need |
3908 | + /// to know. |
3909 | /// |
3910 | /// Attachments (the email's body) is parsed on demand with `body` method. |
3911 | /// |
3912 | - ///To access the email attachments, you need to parse them from the raw email bytes into an |
3913 | - ///`Attachment` object. |
3914 | + ///To access the email attachments, you need to parse them from the raw email |
3915 | + /// bytes into an `Attachment` object. |
3916 | #[derive(Clone, Serialize, Deserialize)] |
3917 | pub struct Envelope { |
3918 | pub hash: EnvelopeHash, |
3919 | @@ -364,7 +373,11 @@ impl Envelope { |
3920 | self.has_attachments = |
3921 | Attachment::check_if_has_attachments_quick(body, boundary); |
3922 | } else { |
3923 | - debug!("{:?} has no boundary field set in multipart/mixed content-type field.", &self); |
3924 | + debug!( |
3925 | + "{:?} has no boundary field set in multipart/mixed content-type \ |
3926 | + field.", |
3927 | + &self |
3928 | + ); |
3929 | } |
3930 | } |
3931 | _ => {} |
3932 | diff --git a/melib/src/email/address.rs b/melib/src/email/address.rs |
3933 | index 4c22c43..37d8bb9 100644 |
3934 | --- a/melib/src/email/address.rs |
3935 | +++ b/melib/src/email/address.rs |
3936 | @@ -19,11 +19,15 @@ |
3937 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
3938 | */ |
3939 | |
3940 | - //! Email addresses. Parsing functions are in [melib::email::parser::address](../parser/address/index.html). |
3941 | + //! Email addresses. Parsing functions are in |
3942 | + //! [melib::email::parser::address](../parser/address/index.html). |
3943 | + use std::{ |
3944 | + collections::HashSet, |
3945 | + convert::TryFrom, |
3946 | + hash::{Hash, Hasher}, |
3947 | + }; |
3948 | + |
3949 | use super::*; |
3950 | - use std::collections::HashSet; |
3951 | - use std::convert::TryFrom; |
3952 | - use std::hash::{Hash, Hasher}; |
3953 | |
3954 | #[derive(Clone, Debug, Serialize, Deserialize)] |
3955 | pub struct GroupAddress { |
3956 | @@ -53,7 +57,7 @@ pub struct GroupAddress { |
3957 | * > display_name │ |
3958 | * > │ |
3959 | * > address_spec |
3960 | - *``` |
3961 | + * ``` |
3962 | */ |
3963 | pub struct MailboxAddress { |
3964 | pub raw: Vec<u8>, |
3965 | @@ -78,14 +82,20 @@ impl PartialEq for MailboxAddress { |
3966 | /// |
3967 | /// ```rust |
3968 | /// # use melib::email::Address; |
3969 | - /// let addr = Address::new(Some("Jörg Doe".to_string()), "joerg@example.com".to_string()); |
3970 | + /// let addr = Address::new( |
3971 | + /// Some("Jörg Doe".to_string()), |
3972 | + /// "joerg@example.com".to_string(), |
3973 | + /// ); |
3974 | /// assert_eq!(addr.to_string().as_str(), "Jörg Doe <joerg@example.com>"); |
3975 | /// ``` |
3976 | /// |
3977 | /// or parse it from a raw value: |
3978 | /// |
3979 | /// ```rust |
3980 | - /// let (rest_bytes, addr) = melib::email::parser::address::address("=?utf-8?q?J=C3=B6rg_Doe?= <joerg@example.com>".as_bytes()).unwrap(); |
3981 | + /// let (rest_bytes, addr) = melib::email::parser::address::address( |
3982 | + /// "=?utf-8?q?J=C3=B6rg_Doe?= <joerg@example.com>".as_bytes(), |
3983 | + /// ) |
3984 | + /// .unwrap(); |
3985 | /// assert!(rest_bytes.is_empty()); |
3986 | /// assert_eq!(addr.get_display_name(), Some("Jörg Doe".to_string())); |
3987 | /// assert_eq!(addr.get_email(), "joerg@example.com".to_string()); |
3988 | @@ -154,8 +164,8 @@ impl Address { |
3989 | |
3990 | /// Get the display name of this address. |
3991 | /// |
3992 | - /// If it's a group, it's the name of the group. Otherwise it's the `display_name` part of |
3993 | - /// the mailbox: |
3994 | + /// If it's a group, it's the name of the group. Otherwise it's the |
3995 | + /// `display_name` part of the mailbox: |
3996 | /// |
3997 | /// |
3998 | /// ```text |
3999 | @@ -166,7 +176,7 @@ impl Address { |
4000 | /// display_name │ display_name │ |
4001 | /// │ │ |
4002 | /// address_spec address_spec |
4003 | - ///``` |
4004 | + /// ``` |
4005 | pub fn get_display_name(&self) -> Option<String> { |
4006 | let ret = match self { |
4007 | Address::Mailbox(m) => m.display_name.display(&m.raw), |
4008 | @@ -179,7 +189,8 @@ impl Address { |
4009 | } |
4010 | } |
4011 | |
4012 | - /// Get the address spec part of this address. A group returns an empty `String`. |
4013 | + /// Get the address spec part of this address. A group returns an empty |
4014 | + /// `String`. |
4015 | pub fn get_email(&self) -> String { |
4016 | match self { |
4017 | Address::Mailbox(m) => m.address_spec.display(&m.raw), |
4018 | @@ -238,8 +249,8 @@ impl Address { |
4019 | |
4020 | /// Get subaddress out of an address (e.g. `ken+subaddress@example.org`). |
4021 | /// |
4022 | - /// Subaddresses are commonly text following a "+" character in an email address's local part |
4023 | - /// . They are defined in [RFC5233 `Sieve Email Filtering: Subaddress Extension`](https://tools.ietf.org/html/rfc5233.html) |
4024 | + /// Subaddresses are commonly text following a "+" character in an email |
4025 | + /// address's local part . They are defined in [RFC5233 `Sieve Email Filtering: Subaddress Extension`](https://tools.ietf.org/html/rfc5233.html) |
4026 | /// |
4027 | /// # Examples |
4028 | /// |
4029 | diff --git a/melib/src/email/attachment_types.rs b/melib/src/email/attachment_types.rs |
4030 | index b00f5a3..a758e79 100644 |
4031 | --- a/melib/src/email/attachment_types.rs |
4032 | +++ b/melib/src/email/attachment_types.rs |
4033 | @@ -18,11 +18,15 @@ |
4034 | * You should have received a copy of the GNU General Public License |
4035 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
4036 | */ |
4037 | - use crate::email::attachments::{Attachment, AttachmentBuilder}; |
4038 | - use crate::email::parser::BytesExt; |
4039 | + use std::{ |
4040 | + fmt::{Display, Formatter, Result as FmtResult}, |
4041 | + str, |
4042 | + }; |
4043 | |
4044 | - use std::fmt::{Display, Formatter, Result as FmtResult}; |
4045 | - use std::str; |
4046 | + use crate::email::{ |
4047 | + attachments::{Attachment, AttachmentBuilder}, |
4048 | + parser::BytesExt, |
4049 | + }; |
4050 | |
4051 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] |
4052 | pub enum Charset { |
4053 | @@ -421,9 +425,10 @@ impl ContentType { |
4054 | |
4055 | boundary.push_str(&random_boundary); |
4056 | /* rfc134 |
4057 | - * "The only mandatory parameter for the multipart Content-Type is the boundary parameter, |
4058 | - * which consists of 1 to 70 characters from a set of characters known to be very robust |
4059 | - * through email gateways, and NOT ending with white space"*/ |
4060 | + * "The only mandatory parameter for the multipart Content-Type is the |
4061 | + * boundary parameter, which consists of 1 to 70 characters from a |
4062 | + * set of characters known to be very robust through email gateways, |
4063 | + * and NOT ending with white space" */ |
4064 | boundary.truncate(70); |
4065 | boundary |
4066 | } |
4067 | diff --git a/melib/src/email/attachments.rs b/melib/src/email/attachments.rs |
4068 | index 0be3963..2485535 100644 |
4069 | --- a/melib/src/email/attachments.rs |
4070 | +++ b/melib/src/email/attachments.rs |
4071 | @@ -20,17 +20,17 @@ |
4072 | */ |
4073 | |
4074 | /*! Encoding/decoding of attachments */ |
4075 | + use core::{fmt, str}; |
4076 | + |
4077 | + use data_encoding::BASE64_MIME; |
4078 | + use smallvec::SmallVec; |
4079 | + |
4080 | use crate::email::{ |
4081 | address::StrBuilder, |
4082 | + attachment_types::*, |
4083 | parser::{self, BytesExt}, |
4084 | Mail, |
4085 | }; |
4086 | - use core::fmt; |
4087 | - use core::str; |
4088 | - use data_encoding::BASE64_MIME; |
4089 | - use smallvec::SmallVec; |
4090 | - |
4091 | - use crate::email::attachment_types::*; |
4092 | |
4093 | pub type Filter<'a> = Box<dyn FnMut(&Attachment, &mut Vec<u8>) + 'a>; |
4094 | |
4095 | @@ -117,8 +117,9 @@ impl AttachmentBuilder { |
4096 | self |
4097 | } |
4098 | |
4099 | - /// Set body to the entire raw contents, use this if raw contains only data and no headers |
4100 | - /// If raw contains data and headers pass it through AttachmentBuilder::new(). |
4101 | + /// Set body to the entire raw contents, use this if raw contains only data |
4102 | + /// and no headers If raw contains data and headers pass it through |
4103 | + /// AttachmentBuilder::new(). |
4104 | pub fn set_body_to_raw(&mut self) -> &mut Self { |
4105 | self.body = StrBuilder { |
4106 | offset: 0, |
4107 | @@ -515,8 +516,8 @@ impl Attachment { |
4108 | } |
4109 | } |
4110 | |
4111 | - /* Call on the body of a multipart/mixed Envelope to check if there are attachments without |
4112 | - * completely parsing them */ |
4113 | + /* Call on the body of a multipart/mixed Envelope to check if there are |
4114 | + * attachments without completely parsing them */ |
4115 | pub fn check_if_has_attachments_quick(bytes: &[u8], boundary: &[u8]) -> bool { |
4116 | if bytes.is_empty() { |
4117 | return false; |
4118 | diff --git a/melib/src/email/compose.rs b/melib/src/email/compose.rs |
4119 | index 924431b..40cf515 100644 |
4120 | --- a/melib/src/email/compose.rs |
4121 | +++ b/melib/src/email/compose.rs |
4122 | @@ -20,19 +20,25 @@ |
4123 | */ |
4124 | |
4125 | /*! Compose a `Draft`, with MIME and attachment support */ |
4126 | - use super::*; |
4127 | - use crate::email::attachment_types::{ |
4128 | - Charset, ContentTransferEncoding, ContentType, MultipartType, |
4129 | + use std::{ |
4130 | + ffi::OsStr, |
4131 | + io::Read, |
4132 | + path::{Path, PathBuf}, |
4133 | + str::FromStr, |
4134 | }; |
4135 | - use crate::email::attachments::AttachmentBuilder; |
4136 | - use crate::shellexpand::ShellExpandTrait; |
4137 | + |
4138 | use data_encoding::BASE64_MIME; |
4139 | - use std::ffi::OsStr; |
4140 | - use std::io::Read; |
4141 | - use std::path::{Path, PathBuf}; |
4142 | - use std::str::FromStr; |
4143 | use xdg_utils::query_mime_info; |
4144 | |
4145 | + use super::*; |
4146 | + use crate::{ |
4147 | + email::{ |
4148 | + attachment_types::{Charset, ContentTransferEncoding, ContentType, MultipartType}, |
4149 | + attachments::AttachmentBuilder, |
4150 | + }, |
4151 | + shellexpand::ShellExpandTrait, |
4152 | + }; |
4153 | + |
4154 | pub mod mime; |
4155 | pub mod random; |
4156 | |
4157 | @@ -370,7 +376,10 @@ fn build_multipart( |
4158 | } |
4159 | ret.push_str("\r\n\r\n"); |
4160 | /* rfc1341 */ |
4161 | - ret.push_str("This is a MIME formatted message with attachments. Use a MIME-compliant client to view it properly.\r\n"); |
4162 | + ret.push_str( |
4163 | + "This is a MIME formatted message with attachments. Use a MIME-compliant client to view \ |
4164 | + it properly.\r\n", |
4165 | + ); |
4166 | for sub in parts { |
4167 | ret.push_str("--"); |
4168 | ret.push_str(&boundary); |
4169 | @@ -484,9 +493,10 @@ fn print_attachment(ret: &mut String, a: AttachmentBuilder) { |
4170 | |
4171 | #[cfg(test)] |
4172 | mod tests { |
4173 | - use super::*; |
4174 | use std::str::FromStr; |
4175 | |
4176 | + use super::*; |
4177 | + |
4178 | #[test] |
4179 | fn test_new_draft() { |
4180 | let mut default = Draft::default(); |
4181 | @@ -508,21 +518,33 @@ mod tests { |
4182 | |
4183 | let original = default.clone(); |
4184 | let s = default.to_edit_string(); |
4185 | - assert_eq!(s, "<!--\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: test_update()\n-->\n\nαδφαφσαφασ"); |
4186 | + assert_eq!( |
4187 | + s, |
4188 | + "<!--\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: \ |
4189 | + test_update()\n-->\n\nαδφαφσαφασ" |
4190 | + ); |
4191 | assert!(!default.update(&s).unwrap()); |
4192 | assert_eq!(&original, &default); |
4193 | |
4194 | default.set_wrap_header_preamble(Some(("".to_string(), "".to_string()))); |
4195 | let original = default.clone(); |
4196 | let s = default.to_edit_string(); |
4197 | - assert_eq!(s, "Date: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: test_update()\n\nαδφαφσαφασ"); |
4198 | + assert_eq!( |
4199 | + s, |
4200 | + "Date: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: \ |
4201 | + test_update()\n\nαδφαφσαφασ" |
4202 | + ); |
4203 | assert!(!default.update(&s).unwrap()); |
4204 | assert_eq!(&original, &default); |
4205 | |
4206 | default.set_wrap_header_preamble(None); |
4207 | let original = default.clone(); |
4208 | let s = default.to_edit_string(); |
4209 | - assert_eq!(s, "Date: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: test_update()\n\nαδφαφσαφασ"); |
4210 | + assert_eq!( |
4211 | + s, |
4212 | + "Date: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: \ |
4213 | + test_update()\n\nαδφαφσαφασ" |
4214 | + ); |
4215 | assert!(!default.update(&s).unwrap()); |
4216 | assert_eq!(&original, &default); |
4217 | |
4218 | @@ -532,7 +554,11 @@ mod tests { |
4219 | ))); |
4220 | let original = default.clone(); |
4221 | let s = default.to_edit_string(); |
4222 | - assert_eq!(s, "{-\n\n\n===========\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: test_update()\n</mixed>\n\nαδφαφσαφασ"); |
4223 | + assert_eq!( |
4224 | + s, |
4225 | + "{-\n\n\n===========\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \ |
4226 | + \nSubject: test_update()\n</mixed>\n\nαδφαφσαφασ" |
4227 | + ); |
4228 | assert!(!default.update(&s).unwrap()); |
4229 | assert_eq!(&original, &default); |
4230 | |
4231 | @@ -543,7 +569,11 @@ mod tests { |
4232 | .set_wrap_header_preamble(Some(("<!--".to_string(), "-->".to_string()))); |
4233 | let original = default.clone(); |
4234 | let s = default.to_edit_string(); |
4235 | - assert_eq!(s, "<!--\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: test_update()\n-->\n\nhellohello<!--\n<!--\n<--hellohello\nhellohello-->\n-->\n-->hello\n"); |
4236 | + assert_eq!( |
4237 | + s, |
4238 | + "<!--\nDate: Sun, 16 Jun 2013 17:56:45 +0200\nFrom: \nTo: \nCc: \nBcc: \nSubject: \ |
4239 | + test_update()\n-->\n\nhellohello<!--\n<!--\n<--hellohello\nhellohello-->\n-->\n-->hello\n" |
4240 | + ); |
4241 | assert!(!default.update(&s).unwrap()); |
4242 | assert_eq!(&original, &default); |
4243 | } |
4244 | @@ -572,7 +602,8 @@ mod tests { |
4245 | */ |
4246 | } |
4247 | |
4248 | - /// Reads file from given path, and returns an 'application/octet-stream' AttachmentBuilder object |
4249 | + /// Reads file from given path, and returns an 'application/octet-stream' |
4250 | + /// AttachmentBuilder object |
4251 | pub fn attachment_from_file<I>(path: &I) -> Result<AttachmentBuilder> |
4252 | where |
4253 | I: AsRef<OsStr>, |
4254 | diff --git a/melib/src/email/compose/mime.rs b/melib/src/email/compose/mime.rs |
4255 | index ef466ee..f47e1b1 100644 |
4256 | --- a/melib/src/email/compose/mime.rs |
4257 | +++ b/melib/src/email/compose/mime.rs |
4258 | @@ -20,7 +20,6 @@ |
4259 | */ |
4260 | |
4261 | use super::*; |
4262 | - |
4263 | #[cfg(feature = "unicode_algorithms")] |
4264 | use crate::text_processing::grapheme_clusters::TextProcessing; |
4265 | |
4266 | @@ -61,9 +60,9 @@ pub fn encode_header(value: &str) -> String { |
4267 | is_current_window_ascii = false; |
4268 | } |
4269 | /* RFC2047 recommends: |
4270 | - * 'While there is no limit to the length of a multiple-line header field, each line of |
4271 | - * a header field that contains one or more 'encoded-word's is limited to 76 |
4272 | - * characters.' |
4273 | + * 'While there is no limit to the length of a multiple-line header field, each |
4274 | + * line of a header field that contains one or more |
4275 | + * 'encoded-word's is limited to 76 characters.' |
4276 | * This is a rough compliance. |
4277 | */ |
4278 | (false, false) if (((4 * (idx - current_window_start) / 3) + 3) & !3) > 33 => { |
4279 | @@ -84,8 +83,8 @@ pub fn encode_header(value: &str) -> String { |
4280 | } |
4281 | #[cfg(not(feature = "unicode_algorithms"))] |
4282 | { |
4283 | - /* TODO: test this. If it works as fine as the one above, there's no need to keep the above |
4284 | - * implementation.*/ |
4285 | + /* TODO: test this. If it works as fine as the one above, there's no need to |
4286 | + * keep the above implementation. */ |
4287 | for (i, g) in value.char_indices() { |
4288 | match (g.is_ascii(), is_current_window_ascii) { |
4289 | (true, true) => { |
4290 | @@ -116,9 +115,9 @@ pub fn encode_header(value: &str) -> String { |
4291 | is_current_window_ascii = false; |
4292 | } |
4293 | /* RFC2047 recommends: |
4294 | - * 'While there is no limit to the length of a multiple-line header field, each line of |
4295 | - * a header field that contains one or more 'encoded-word's is limited to 76 |
4296 | - * characters.' |
4297 | + * 'While there is no limit to the length of a multiple-line header field, each |
4298 | + * line of a header field that contains one or more |
4299 | + * 'encoded-word's is limited to 76 characters.' |
4300 | * This is a rough compliance. |
4301 | */ |
4302 | (false, false) |
4303 | @@ -139,8 +138,8 @@ pub fn encode_header(value: &str) -> String { |
4304 | } |
4305 | } |
4306 | } |
4307 | - /* If the last part of the header value is encoded, it won't be pushed inside the previous for |
4308 | - * block */ |
4309 | + /* If the last part of the header value is encoded, it won't be pushed inside |
4310 | + * the previous for block */ |
4311 | if !is_current_window_ascii { |
4312 | ret.push_str(&format!( |
4313 | "=?UTF-8?B?{}?=", |
4314 | @@ -156,35 +155,39 @@ fn test_encode_header() { |
4315 | let words = "compilers/2020a σε Rust"; |
4316 | assert_eq!( |
4317 | "compilers/2020a =?UTF-8?B?z4POtSA=?=Rust", |
4318 | - &encode_header(&words), |
4319 | + &encode_header(words), |
4320 | ); |
4321 | assert_eq!( |
4322 | &std::str::from_utf8( |
4323 | - &crate::email::parser::encodings::phrase(encode_header(&words).as_bytes(), false) |
4324 | + &crate::email::parser::encodings::phrase(encode_header(words).as_bytes(), false) |
4325 | .unwrap() |
4326 | .1 |
4327 | ) |
4328 | .unwrap(), |
4329 | &words, |
4330 | ); |
4331 | - let words = "[internal] =?UTF-8?B?zp3Orc6/z4Igzp/OtM63zrPPjM+CIM6jz4U=?= =?UTF-8?B?zrPOs8+BzrHPhs6uz4I=?="; |
4332 | + let words = "[internal] =?UTF-8?B?zp3Orc6/z4Igzp/OtM63zrPPjM+CIM6jz4U=?= \ |
4333 | + =?UTF-8?B?zrPOs8+BzrHPhs6uz4I=?="; |
4334 | let words_enc = r#"[internal] Νέος Οδηγός Συγγραφής"#; |
4335 | - assert_eq!(words, &encode_header(&words_enc),); |
4336 | + assert_eq!(words, &encode_header(words_enc),); |
4337 | assert_eq!( |
4338 | r#"[internal] Νέος Οδηγός Συγγραφής"#, |
4339 | std::str::from_utf8( |
4340 | - &crate::email::parser::encodings::phrase(encode_header(&words_enc).as_bytes(), false) |
4341 | + &crate::email::parser::encodings::phrase(encode_header(words_enc).as_bytes(), false) |
4342 | .unwrap() |
4343 | .1 |
4344 | ) |
4345 | .unwrap(), |
4346 | ); |
4347 | - //let words = "[Advcomparch] =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b?dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b?IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?="; |
4348 | + //let words = "[Advcomparch] |
4349 | + // =?utf-8?b?zqPPhc68z4DOtc+BzrnPhs6/z4HOrCDPg861IGZs?=\n\t=?utf-8?b? |
4350 | + // dXNoIM67z4zOs8+JIG1pc3ByZWRpY3Rpb24gzrrOsc+Ezqwgz4TOt869?=\n\t=?utf-8?b? |
4351 | + // IM61zrrPhM6tzrvOtc+Dzrcgc3RvcmU=?="; |
4352 | let words_enc = "[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store"; |
4353 | assert_eq!( |
4354 | "[Advcomparch] Συμπεριφορά σε flush λόγω misprediction κατά την εκτέλεση store", |
4355 | std::str::from_utf8( |
4356 | - &crate::email::parser::encodings::phrase(encode_header(&words_enc).as_bytes(), false) |
4357 | + &crate::email::parser::encodings::phrase(encode_header(words_enc).as_bytes(), false) |
4358 | .unwrap() |
4359 | .1 |
4360 | ) |
4361 | diff --git a/melib/src/email/compose/random.rs b/melib/src/email/compose/random.rs |
4362 | index 6e5cbe3..67fba6c 100644 |
4363 | --- a/melib/src/email/compose/random.rs |
4364 | +++ b/melib/src/email/compose/random.rs |
4365 | @@ -19,10 +19,7 @@ |
4366 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
4367 | */ |
4368 | |
4369 | - use std::char; |
4370 | - use std::fs::File; |
4371 | - use std::io::prelude::*; |
4372 | - use std::time::SystemTime; |
4373 | + use std::{char, fs::File, io::prelude::*, time::SystemTime}; |
4374 | |
4375 | fn random_u64() -> u64 { |
4376 | let mut f = File::open("/dev/urandom").unwrap(); |
4377 | diff --git a/melib/src/email/headers.rs b/melib/src/email/headers.rs |
4378 | index f748669..2be6bd5 100644 |
4379 | --- a/melib/src/email/headers.rs |
4380 | +++ b/melib/src/email/headers.rs |
4381 | @@ -20,20 +20,25 @@ |
4382 | */ |
4383 | |
4384 | /*! Wrapper type `HeaderName` for case-insensitive comparisons */ |
4385 | - use crate::error::Error; |
4386 | + use std::{ |
4387 | + borrow::Borrow, |
4388 | + cmp::{Eq, PartialEq}, |
4389 | + convert::TryFrom, |
4390 | + fmt, |
4391 | + hash::{Hash, Hasher}, |
4392 | + ops::{Deref, DerefMut}, |
4393 | + }; |
4394 | + |
4395 | use indexmap::IndexMap; |
4396 | use smallvec::SmallVec; |
4397 | - use std::borrow::Borrow; |
4398 | - use std::cmp::{Eq, PartialEq}; |
4399 | - use std::convert::TryFrom; |
4400 | - use std::fmt; |
4401 | - use std::hash::{Hash, Hasher}; |
4402 | - use std::ops::{Deref, DerefMut}; |
4403 | + |
4404 | + use crate::error::Error; |
4405 | |
4406 | #[derive(Clone, Copy, Serialize, Deserialize)] |
4407 | pub struct HeaderNameType<S>(S); |
4408 | |
4409 | - ///Case insensitive wrapper for a header name. As of `RFC5322` it's guaranteened to be ASCII. |
4410 | + /// Case insensitive wrapper for a header name. As of `RFC5322` it's |
4411 | + /// guaranteed to be ASCII. |
4412 | pub type HeaderName = HeaderNameType<SmallVec<[u8; 32]>>; |
4413 | |
4414 | impl HeaderName { |
4415 | @@ -148,7 +153,7 @@ impl<'a> Borrow<dyn HeaderKey + 'a> for HeaderName { |
4416 | |
4417 | impl<S: AsRef<[u8]>> HeaderNameType<S> { |
4418 | pub fn as_str(&self) -> &str { |
4419 | - //HeadersType are ascii so valid utf8 |
4420 | + // HeadersType are ascii so valid utf8 |
4421 | unsafe { std::str::from_utf8_unchecked(self.0.as_ref()) } |
4422 | } |
4423 | |
4424 | diff --git a/melib/src/email/list_management.rs b/melib/src/email/list_management.rs |
4425 | index b0e07d8..5129480 100644 |
4426 | --- a/melib/src/email/list_management.rs |
4427 | +++ b/melib/src/email/list_management.rs |
4428 | @@ -20,11 +20,12 @@ |
4429 | */ |
4430 | |
4431 | /*! Parsing of rfc2369/rfc2919 `List-*` headers */ |
4432 | - use super::parser; |
4433 | - use super::Envelope; |
4434 | - use smallvec::SmallVec; |
4435 | use std::convert::From; |
4436 | |
4437 | + use smallvec::SmallVec; |
4438 | + |
4439 | + use super::{parser, Envelope}; |
4440 | + |
4441 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
4442 | pub enum ListAction<'a> { |
4443 | Url(&'a [u8]), |
4444 | @@ -43,8 +44,8 @@ impl<'a> From<&'a [u8]> for ListAction<'a> { |
4445 | } else if value.starts_with(b"NO") { |
4446 | ListAction::No |
4447 | } else { |
4448 | - /* Otherwise treat it as url. There's no foolproof way to check if this is valid, so |
4449 | - * postpone it until we try an HTTP request. |
4450 | + /* Otherwise treat it as url. There's no foolproof way to check if this is |
4451 | + * valid, so postpone it until we try an HTTP request. |
4452 | */ |
4453 | ListAction::Url(value) |
4454 | } |
4455 | @@ -55,8 +56,8 @@ impl<'a> ListAction<'a> { |
4456 | pub fn parse_options_list(input: &'a [u8]) -> Option<SmallVec<[ListAction<'a>; 4]>> { |
4457 | parser::mailing_lists::rfc_2369_list_headers_action_list(input) |
4458 | .map(|(_, mut vec)| { |
4459 | - /* Prefer email options first, since this _is_ a mail client after all and it's |
4460 | - * more automated */ |
4461 | + /* Prefer email options first, since this _is_ a mail client after all and |
4462 | + * it's more automated */ |
4463 | vec.sort_unstable_by(|a, b| { |
4464 | match (a.starts_with(b"mailto:"), b.starts_with(b"mailto:")) { |
4465 | (true, false) => std::cmp::Ordering::Less, |
4466 | diff --git a/melib/src/email/mailto.rs b/melib/src/email/mailto.rs |
4467 | index f41167f..998b4a2 100644 |
4468 | --- a/melib/src/email/mailto.rs |
4469 | +++ b/melib/src/email/mailto.rs |
4470 | @@ -20,9 +20,10 @@ |
4471 | */ |
4472 | |
4473 | /*! Parsing of `mailto` addresses */ |
4474 | - use super::*; |
4475 | use std::convert::TryFrom; |
4476 | |
4477 | + use super::*; |
4478 | + |
4479 | #[derive(Debug, Clone)] |
4480 | pub struct Mailto { |
4481 | pub address: Address, |
4482 | diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs |
4483 | index efb66fa..c1bd25b 100644 |
4484 | --- a/melib/src/email/parser.rs |
4485 | +++ b/melib/src/email/parser.rs |
4486 | @@ -20,20 +20,21 @@ |
4487 | */ |
4488 | |
4489 | /*! Parsers for email. See submodules */ |
4490 | - use crate::error::{Error, Result, ResultIntoError}; |
4491 | + use std::borrow::Cow; |
4492 | + |
4493 | use nom::{ |
4494 | branch::alt, |
4495 | bytes::complete::{is_a, is_not, tag, take, take_until, take_while, take_while1}, |
4496 | character::{is_alphabetic, is_digit, is_hex_digit}, |
4497 | - combinator::peek, |
4498 | - combinator::{map, opt}, |
4499 | + combinator::{map, opt, peek}, |
4500 | error::{context, ErrorKind}, |
4501 | multi::{many0, many1, separated_list1}, |
4502 | number::complete::le_u8, |
4503 | sequence::{delimited, pair, preceded, separated_pair, terminated}, |
4504 | }; |
4505 | use smallvec::SmallVec; |
4506 | - use std::borrow::Cow; |
4507 | + |
4508 | + use crate::error::{Error, Result, ResultIntoError}; |
4509 | |
4510 | macro_rules! to_str { |
4511 | ($l:expr) => {{ |
4512 | @@ -318,8 +319,7 @@ pub fn mail(input: &[u8]) -> Result<(Vec<(&[u8], &[u8])>, &[u8])> { |
4513 | |
4514 | pub mod dates { |
4515 | /*! Date values in headers */ |
4516 | - use super::generic::*; |
4517 | - use super::*; |
4518 | + use super::{generic::*, *}; |
4519 | use crate::datetime::UnixTimestamp; |
4520 | |
4521 | fn take_n_digits(n: usize) -> impl Fn(&[u8]) -> IResult<&[u8], &[u8]> { |
4522 | @@ -451,15 +451,15 @@ pub mod dates { |
4523 | |
4524 | ///e.g Wed Sep 9 00:27:54 2020 |
4525 | ///```text |
4526 | - ///day-of-week month day time year |
4527 | - ///date-time = [ day-of-week "," ] date time [CFWS] |
4528 | - ///date = day month year |
4529 | - ///time = time-of-day zone |
4530 | - ///time-of-day = hour ":" minute [ ":" second ] |
4531 | - ///hour = 2DIGIT / obs-hour |
4532 | - ///minute = 2DIGIT / obs-minute |
4533 | - ///second = 2DIGIT / obs-second |
4534 | - ///``` |
4535 | + /// day-of-week month day time year |
4536 | + /// date-time = [ day-of-week "," ] date time [CFWS] |
4537 | + /// date = day month year |
4538 | + /// time = time-of-day zone |
4539 | + /// time-of-day = hour ":" minute [ ":" second ] |
4540 | + /// hour = 2DIGIT / obs-hour |
4541 | + /// minute = 2DIGIT / obs-minute |
4542 | + /// second = 2DIGIT / obs-second |
4543 | + /// ``` |
4544 | pub fn mbox_date_time(input: &[u8]) -> IResult<&[u8], UnixTimestamp> { |
4545 | let orig_input = input; |
4546 | let mut accum: SmallVec<[u8; 32]> = SmallVec::new(); |
4547 | @@ -656,7 +656,8 @@ pub mod generic { |
4548 | let (rest, _) = utf8_tail(rest)?; |
4549 | Ok((rest, &input[0..2])) |
4550 | } |
4551 | - /// UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) |
4552 | + /// UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED |
4553 | + /// %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) |
4554 | fn utf8_3<'a>(input: &'a [u8]) -> IResult<&'a [u8], &'a [u8]> { |
4555 | alt(( |
4556 | |input: &'a [u8]| -> IResult<&'a [u8], &'a [u8]> { |
4557 | @@ -685,7 +686,8 @@ pub mod generic { |
4558 | }, |
4559 | ))(input) |
4560 | } |
4561 | - /// UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / %xF4 %x80-8F 2( UTF8-tail ) |
4562 | + /// UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / |
4563 | + /// %xF4 %x80-8F 2( UTF8-tail ) |
4564 | fn utf8_4<'a>(input: &'a [u8]) -> IResult<&'a [u8], &'a [u8]> { |
4565 | alt(( |
4566 | |input: &'a [u8]| -> IResult<&'a [u8], &'a [u8]> { |
4567 | @@ -741,11 +743,11 @@ pub mod generic { |
4568 | } |
4569 | |
4570 | ///```text |
4571 | - ///ctext = %d33-39 / ; Printable US-ASCII |
4572 | + /// ctext = %d33-39 / ; Printable US-ASCII |
4573 | /// %d42-91 / ; characters not including |
4574 | /// %d93-126 / ; "(", ")", or "\" |
4575 | /// obs-ctext |
4576 | - ///``` |
4577 | + /// ``` |
4578 | fn ctext(input: &[u8]) -> IResult<&[u8], ()> { |
4579 | alt(( |
4580 | map( |
4581 | @@ -761,13 +763,13 @@ pub mod generic { |
4582 | } |
4583 | |
4584 | ///```text |
4585 | - ///ctext = %d33-39 / ; Printable US-ASCII |
4586 | + /// ctext = %d33-39 / ; Printable US-ASCII |
4587 | /// %d42-91 / ; characters not including |
4588 | /// %d93-126 / ; "(", ")", or "\" |
4589 | /// obs-ctext |
4590 | - ///ccontent = ctext / quoted-pair / comment |
4591 | - ///comment = "(" *([FWS] ccontent) [FWS] ")" |
4592 | - ///``` |
4593 | + /// ccontent = ctext / quoted-pair / comment |
4594 | + /// comment = "(" *([FWS] ccontent) [FWS] ")" |
4595 | + /// ``` |
4596 | pub fn comment(input: &[u8]) -> IResult<&[u8], ()> { |
4597 | if !input.starts_with(b"(") { |
4598 | return Err(nom::Err::Error( |
4599 | @@ -911,8 +913,7 @@ pub mod generic { |
4600 | } |
4601 | } |
4602 | |
4603 | - use crate::email::address::Address; |
4604 | - use crate::email::mailto::Mailto; |
4605 | + use crate::email::{address::Address, mailto::Mailto}; |
4606 | pub fn mailto(mut input: &[u8]) -> IResult<&[u8], Mailto> { |
4607 | if !input.starts_with(b"mailto:") { |
4608 | return Err(nom::Err::Error( |
4609 | @@ -1081,7 +1082,8 @@ pub mod generic { |
4610 | Ok((rest, ret)) |
4611 | } |
4612 | |
4613 | - ///`quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS]` |
4614 | + ///`quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE |
4615 | + /// [CFWS]` |
4616 | pub fn quoted_string(input: &[u8]) -> IResult<&[u8], Cow<'_, [u8]>> { |
4617 | let (input, opt_space) = opt(cfws)(input)?; |
4618 | if !input.starts_with(b"\"") { |
4619 | @@ -1213,7 +1215,10 @@ pub mod generic { |
4620 | Ok((input, ret.into())) |
4621 | } |
4622 | |
4623 | - ///`atext = ALPHA / DIGIT / ; Printable US-ASCII "!" / "#" / ; characters not including "$" / "%" / ; specials. Used for atoms. "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"` |
4624 | + ///`atext = ALPHA / DIGIT / ; Printable US-ASCII "!" / "#" / |
4625 | + /// ; characters not including "$" / "%" / ; specials. Used for |
4626 | + /// atoms. "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" |
4627 | + /// / "{" / "|" / "}" / "~"` |
4628 | pub fn atext_ascii(input: &[u8]) -> IResult<&[u8], Cow<'_, [u8]>> { |
4629 | if input.is_empty() { |
4630 | return Err(nom::Err::Error((input, "atext(): empty input").into())); |
4631 | @@ -1244,10 +1249,10 @@ pub mod generic { |
4632 | } |
4633 | |
4634 | ///```text |
4635 | - ///dtext = %d33-90 / ; Printable US-ASCII |
4636 | + /// dtext = %d33-90 / ; Printable US-ASCII |
4637 | /// %d94-126 / ; characters not including |
4638 | /// obs-dtext ; "[", "]", or "\" |
4639 | - ///``` |
4640 | + /// ``` |
4641 | pub fn dtext(input: &[u8]) -> IResult<&[u8], u8> { |
4642 | alt((byte_in_range(33, 90), byte_in_range(94, 125)))(input) |
4643 | } |
4644 | @@ -1259,11 +1264,13 @@ pub mod mailing_lists { |
4645 | //! Implemented RFCs: |
4646 | //! |
4647 | //! - [RFC2369 "The Use of URLs as Meta-Syntax for Core Mail List Commands and their Transport through Message Header Fields"](https://tools.ietf.org/html/rfc2369) |
4648 | - use super::*; |
4649 | use generic::cfws; |
4650 | |
4651 | - ///Parse the value of headers defined in RFC2369 "The Use of URLs as Meta-Syntax for Core |
4652 | - ///Mail List Commands and their Transport through Message Header Fields" |
4653 | + use super::*; |
4654 | + |
4655 | + ///Parse the value of headers defined in RFC2369 "The Use of URLs as |
4656 | + /// Meta-Syntax for Core Mail List Commands and their Transport through |
4657 | + /// Message Header Fields" |
4658 | pub fn rfc_2369_list_headers_action_list(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { |
4659 | let (input, _) = opt(cfws)(input)?; |
4660 | let (input, ret) = alt(( |
4661 | @@ -1458,9 +1465,9 @@ pub mod headers { |
4662 | /* A header can span multiple lines, eg: |
4663 | * |
4664 | * Received: from -------------------- (-------------------------) |
4665 | - * by --------------------- (--------------------- [------------------]) (-----------------------) |
4666 | - * with ESMTP id ------------ for <------------------->; |
4667 | - * Tue, 5 Jan 2016 21:30:44 +0100 (CET) |
4668 | + * by --------------------- (--------------------- [------------------]) |
4669 | + * (-----------------------) with ESMTP id ------------ for |
4670 | + * <------------------->; Tue, 5 Jan 2016 21:30:44 +0100 (CET) |
4671 | */ |
4672 | |
4673 | pub fn header_value(input: &[u8]) -> IResult<&[u8], &[u8]> { |
4674 | @@ -1580,8 +1587,10 @@ pub mod headers { |
4675 | pub mod attachments { |
4676 | /*! Email attachments */ |
4677 | use super::*; |
4678 | - use crate::email::address::*; |
4679 | - use crate::email::attachment_types::{ContentDisposition, ContentDispositionKind}; |
4680 | + use crate::email::{ |
4681 | + address::*, |
4682 | + attachment_types::{ContentDisposition, ContentDispositionKind}, |
4683 | + }; |
4684 | pub fn attachment(input: &[u8]) -> IResult<&[u8], (std::vec::Vec<(&[u8], &[u8])>, &[u8])> { |
4685 | alt(( |
4686 | separated_pair( |
4687 | @@ -1807,7 +1816,8 @@ pub mod attachments { |
4688 | pub fn content_disposition(input: &[u8]) -> IResult<&[u8], ContentDisposition> { |
4689 | let (input, kind) = alt((take_until(";"), take_while(|_| true)))(input.trim())?; |
4690 | let mut ret = ContentDisposition { |
4691 | - /* RFC2183 Content-Disposition: "Unrecognized disposition types should be treated as `attachment'." */ |
4692 | + /* RFC2183 Content-Disposition: "Unrecognized disposition types should be treated as |
4693 | + * `attachment'." */ |
4694 | kind: if kind.trim().eq_ignore_ascii_case(b"inline") { |
4695 | ContentDispositionKind::Inline |
4696 | } else { |
4697 | @@ -1846,11 +1856,11 @@ pub mod attachments { |
4698 | |
4699 | pub mod encodings { |
4700 | /*! Email encodings (quoted printable, MIME) */ |
4701 | + use data_encoding::BASE64_MIME; |
4702 | + use encoding::{all::*, DecoderTrap, Encoding}; |
4703 | + |
4704 | use super::*; |
4705 | use crate::email::attachment_types::Charset; |
4706 | - use data_encoding::BASE64_MIME; |
4707 | - use encoding::all::*; |
4708 | - use encoding::{DecoderTrap, Encoding}; |
4709 | pub fn quoted_printable_byte(input: &[u8]) -> IResult<&[u8], u8> { |
4710 | if input.len() < 3 { |
4711 | Err(nom::Err::Error( |
4712 | @@ -2023,7 +2033,8 @@ pub mod encodings { |
4713 | if input.starts_with(b"=\n") { |
4714 | Ok((&input[2..], input[1])) // `=\n` is an escaped space character. |
4715 | } else if input.starts_with(b"=\r\n") { |
4716 | - Ok((&input[3..], input[2])) // `=\r\n` is an escaped space character. |
4717 | + Ok((&input[3..], input[2])) // `=\r\n` is an escaped space |
4718 | + // character. |
4719 | } else { |
4720 | Err(nom::Err::Error( |
4721 | (input, "quoted_printable_soft_break(): invalid input").into(), |
4722 | @@ -2036,8 +2047,9 @@ pub mod encodings { |
4723 | Ok((rest, 0x20)) |
4724 | } |
4725 | |
4726 | - // With MIME, headers in quoted printable format can contain underscores that represent spaces. |
4727 | - // In non-header context, an underscore is just a plain underscore. |
4728 | + // With MIME, headers in quoted printable format can contain underscores that |
4729 | + // represent spaces. In non-header context, an underscore is just a plain |
4730 | + // underscore. |
4731 | pub fn quoted_printable_bytes_header(input: &[u8]) -> IResult<&[u8], Vec<u8>> { |
4732 | many0(alt((quoted_printable_byte, qp_underscore_header, le_u8)))(input) |
4733 | } |
4734 | @@ -2173,9 +2185,9 @@ pub mod address { |
4735 | //! - [RFC6532 "Internationalized Email Headers"](https://tools.ietf.org/html/rfc6532) |
4736 | //! - [RFC2047 "MIME Part Three: Message Header Extensions for Non-ASCII Text"](https://tools.ietf.org/html/rfc2047) |
4737 | use super::*; |
4738 | - use crate::email::address::*; |
4739 | - use crate::email::parser::generic::{ |
4740 | - atom, cfws, dot_atom, dot_atom_text, dtext, phrase2, quoted_string, |
4741 | + use crate::email::{ |
4742 | + address::*, |
4743 | + parser::generic::{atom, cfws, dot_atom, dot_atom_text, dtext, phrase2, quoted_string}, |
4744 | }; |
4745 | pub fn display_addr(input: &[u8]) -> IResult<&[u8], Address> { |
4746 | if input.is_empty() || input.len() < 3 { |
4747 | @@ -2447,8 +2459,8 @@ pub mod address { |
4748 | } |
4749 | |
4750 | ///```text |
4751 | - ///address = mailbox / group |
4752 | - ///``` |
4753 | + /// address = mailbox / group |
4754 | + /// ``` |
4755 | pub fn address(input: &[u8]) -> IResult<&[u8], Address> { |
4756 | alt((mailbox, group))(input) |
4757 | } |
4758 | @@ -2599,15 +2611,18 @@ pub mod address { |
4759 | #[cfg(test)] |
4760 | mod tests { |
4761 | use super::{address::*, encodings::*, *}; |
4762 | - use crate::email::address::*; |
4763 | - use crate::make_address; |
4764 | + use crate::{email::address::*, make_address}; |
4765 | |
4766 | #[test] |
4767 | fn test_phrase() { |
4768 | let words = b"=?iso-8859-7?B?W215Y291cnNlcy5udHVhLmdyIC0gyvXs4fTp6t4g6uHpIMri4e306ere?= |
4769 | =?iso-8859-7?B?INb18+nq3l0gzd3hIMHt4erv3+358+c6IMzF0c/TIMHQz9TFy8XTzMHU?= |
4770 | =?iso-8859-7?B?2c0gwiDUzC4gysHNLiDFzsXUwdPH0yAyMDE3LTE4OiDTx8zFydnTxw==?="; |
4771 | - assert_eq!("[mycourses.ntua.gr - Κυματική και Κβαντική Φυσική] Νέα Ανακοίνωση: ΜΕΡΟΣ ΑΠΟΤΕΛΕΣΜΑΤΩΝ Β ΤΜ. ΚΑΝ. ΕΞΕΤΑΣΗΣ 2017-18: ΣΗΜΕΙΩΣΗ" , std::str::from_utf8(&phrase(words.trim(), false).unwrap().1).unwrap()); |
4772 | + assert_eq!( |
4773 | + "[mycourses.ntua.gr - Κυματική και Κβαντική Φυσική] Νέα Ανακοίνωση: ΜΕΡΟΣ \ |
4774 | + ΑΠΟΤΕΛΕΣΜΑΤΩΝ Β ΤΜ. ΚΑΝ. ΕΞΕΤΑΣΗΣ 2017-18: ΣΗΜΕΙΩΣΗ", |
4775 | + std::str::from_utf8(&phrase(words.trim(), false).unwrap().1).unwrap() |
4776 | + ); |
4777 | let words = b"=?UTF-8?Q?=CE=A0=CF=81=CF=8C=CF=83=CE=B8=CE=B5?= =?UTF-8?Q?=CF=84=CE=B7_=CE=B5=CE=BE=CE=B5=CF=84?= =?UTF-8?Q?=CE=B1=CF=83=CF=84=CE=B9=CE=BA=CE=AE?="; |
4778 | assert_eq!( |
4779 | "Πρόσθετη εξεταστική", |
4780 | @@ -2929,12 +2944,16 @@ mod tests { |
4781 | "=?iso-8859-1?q?Fran=E7ois?= Pons <fpons@mandrakesoft.com>" |
4782 | ); |
4783 | assert_parse!( |
4784 | - "هل تتكلم اللغة الإنجليزية /العربية؟", "do.you.speak@arabic.com", |
4785 | - "=?utf-8?b?2YfZhCDYqtiq2YPZhNmFINin2YTZhNi62Kkg2KfZhNil2YbYrNmE2YrYstmK2Kk=?=\n =?utf-8?b?IC/Yp9mE2LnYsdio2YrYqdif?= <do.you.speak@arabic.com>" |
4786 | + "هل تتكلم اللغة الإنجليزية /العربية؟", |
4787 | + "do.you.speak@arabic.com", |
4788 | + "=?utf-8?b?2YfZhCDYqtiq2YPZhNmFINin2YTZhNi62Kkg2KfZhNil2YbYrNmE2YrYstmK2Kk=?=\n \ |
4789 | + =?utf-8?b?IC/Yp9mE2LnYsdio2YrYqdif?= <do.you.speak@arabic.com>" |
4790 | ); |
4791 | assert_parse!( |
4792 | - "狂ったこの世で狂うなら気は確かだ。", "famous@quotes.ja", |
4793 | - "=?utf-8?b?54uC44Gj44Gf44GT44Gu5LiW44Gn54uC44GG44Gq44KJ5rCX44Gv56K644GL44Gg?=\n =?utf-8?b?44CC?= <famous@quotes.ja>" |
4794 | + "狂ったこの世で狂うなら気は確かだ。", |
4795 | + "famous@quotes.ja", |
4796 | + "=?utf-8?b?54uC44Gj44Gf44GT44Gu5LiW44Gn54uC44GG44Gq44KJ5rCX44Gv56K644GL44Gg?=\n \ |
4797 | + =?utf-8?b?44CC?= <famous@quotes.ja>" |
4798 | ); |
4799 | assert_eq!( |
4800 | Address::new_group( |
4801 | diff --git a/melib/src/email/pgp.rs b/melib/src/email/pgp.rs |
4802 | index d17e725..507f785 100644 |
4803 | --- a/melib/src/email/pgp.rs |
4804 | +++ b/melib/src/email/pgp.rs |
4805 | @@ -20,11 +20,13 @@ |
4806 | */ |
4807 | |
4808 | /*! Verification of OpenPGP signatures */ |
4809 | - use crate::email::{ |
4810 | - attachment_types::{ContentType, MultipartType}, |
4811 | - attachments::Attachment, |
4812 | + use crate::{ |
4813 | + email::{ |
4814 | + attachment_types::{ContentType, MultipartType}, |
4815 | + attachments::Attachment, |
4816 | + }, |
4817 | + Error, Result, |
4818 | }; |
4819 | - use crate::{Error, Result}; |
4820 | |
4821 | /// Convert raw attachment to the form needed for signature verification ([rfc3156](https://tools.ietf.org/html/rfc3156)) |
4822 | /// |
4823 | diff --git a/melib/src/error.rs b/melib/src/error.rs |
4824 | index 8e57664..4f1515d 100644 |
4825 | --- a/melib/src/error.rs |
4826 | +++ b/melib/src/error.rs |
4827 | @@ -23,13 +23,7 @@ |
4828 | * An error object for `melib` |
4829 | */ |
4830 | |
4831 | - use std::borrow::Cow; |
4832 | - use std::fmt; |
4833 | - use std::io; |
4834 | - use std::result; |
4835 | - use std::str; |
4836 | - use std::string; |
4837 | - use std::sync::Arc; |
4838 | + use std::{borrow::Cow, fmt, io, result, str, string, sync::Arc}; |
4839 | |
4840 | pub type Result<T> = result::Result<T, Error>; |
4841 | |
4842 | diff --git a/melib/src/gpgme/bindings.rs b/melib/src/gpgme/bindings.rs |
4843 | index 4883b89..4ff9258 100644 |
4844 | --- a/melib/src/gpgme/bindings.rs |
4845 | +++ b/melib/src/gpgme/bindings.rs |
4846 | @@ -195,8 +195,7 @@ pub struct gpgme_data { |
4847 | } |
4848 | pub type gpgme_data_t = *mut gpgme_data; |
4849 | pub type gpgme_error_t = gpg_error_t; |
4850 | - pub use self::gpg_err_code_t as gpgme_err_code_t; |
4851 | - pub use self::gpg_err_source_t as gpgme_err_source_t; |
4852 | + pub use self::{gpg_err_code_t as gpgme_err_code_t, gpg_err_source_t as gpgme_err_source_t}; |
4853 | pub type gpgme_strerror = extern "C" fn(err: gpgme_error_t) -> *const ::std::os::raw::c_char; |
4854 | pub type gpgme_strerror_r = unsafe extern "C" fn( |
4855 | err: gpg_error_t, |
4856 | @@ -5326,14 +5325,12 @@ pub type gpgme_op_assuan_transact = extern "C" fn( |
4857 | pub type GpgmeCtx = gpgme_ctx_t; |
4858 | pub type GpgmeData = gpgme_data_t; |
4859 | pub type GpgmeError = gpgme_error_t; |
4860 | - pub use self::gpgme_attr_t as GpgmeAttr; |
4861 | - pub use self::gpgme_data_encoding_t as GpgmeDataEncoding; |
4862 | - pub use self::gpgme_hash_algo_t as GpgmeHashAlgo; |
4863 | - pub use self::gpgme_protocol_t as GpgmeProtocol; |
4864 | - pub use self::gpgme_pubkey_algo_t as GpgmePubKeyAlgo; |
4865 | - pub use self::gpgme_sig_mode_t as GpgmeSigMode; |
4866 | - pub use self::gpgme_sig_stat_t as GpgmeSigStat; |
4867 | - pub use self::gpgme_validity_t as GpgmeValidity; |
4868 | + pub use self::{ |
4869 | + gpgme_attr_t as GpgmeAttr, gpgme_data_encoding_t as GpgmeDataEncoding, |
4870 | + gpgme_hash_algo_t as GpgmeHashAlgo, gpgme_protocol_t as GpgmeProtocol, |
4871 | + gpgme_pubkey_algo_t as GpgmePubKeyAlgo, gpgme_sig_mode_t as GpgmeSigMode, |
4872 | + gpgme_sig_stat_t as GpgmeSigStat, gpgme_validity_t as GpgmeValidity, |
4873 | + }; |
4874 | pub type GpgmeEngineInfo = gpgme_engine_info_t; |
4875 | pub type GpgmeSubkey = gpgme_subkey_t; |
4876 | pub type GpgmeKeySig = gpgme_key_sig_t; |
4877 | diff --git a/melib/src/gpgme/io.rs b/melib/src/gpgme/io.rs |
4878 | index 5d37578..d716e35 100644 |
4879 | --- a/melib/src/gpgme/io.rs |
4880 | +++ b/melib/src/gpgme/io.rs |
4881 | @@ -19,9 +19,10 @@ |
4882 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
4883 | */ |
4884 | |
4885 | - use super::*; |
4886 | use std::io::{self, Read, Seek, Write}; |
4887 | |
4888 | + use super::*; |
4889 | + |
4890 | #[repr(C)] |
4891 | struct TagData { |
4892 | idx: usize, |
4893 | diff --git a/melib/src/gpgme/mod.rs b/melib/src/gpgme/mod.rs |
4894 | index 511d4cc..858a14c 100644 |
4895 | --- a/melib/src/gpgme/mod.rs |
4896 | +++ b/melib/src/gpgme/mod.rs |
4897 | @@ -19,26 +19,34 @@ |
4898 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
4899 | */ |
4900 | |
4901 | - use crate::email::{ |
4902 | - pgp::{DecryptionMetadata, Recipient}, |
4903 | - Address, |
4904 | + use std::{ |
4905 | + borrow::Cow, |
4906 | + collections::HashMap, |
4907 | + ffi::{CStr, CString, OsStr}, |
4908 | + future::Future, |
4909 | + io::Seek, |
4910 | + os::unix::{ |
4911 | + ffi::OsStrExt, |
4912 | + io::{AsRawFd, RawFd}, |
4913 | + }, |
4914 | + path::Path, |
4915 | + sync::{Arc, Mutex}, |
4916 | }; |
4917 | - use crate::error::{Error, ErrorKind, IntoError, Result, ResultIntoError}; |
4918 | + |
4919 | use futures::FutureExt; |
4920 | use serde::{ |
4921 | de::{self, Deserialize}, |
4922 | Deserializer, Serialize, Serializer, |
4923 | }; |
4924 | use smol::Async; |
4925 | - use std::borrow::Cow; |
4926 | - use std::collections::HashMap; |
4927 | - use std::ffi::{CStr, CString, OsStr}; |
4928 | - use std::future::Future; |
4929 | - use std::io::Seek; |
4930 | - use std::os::unix::ffi::OsStrExt; |
4931 | - use std::os::unix::io::{AsRawFd, RawFd}; |
4932 | - use std::path::Path; |
4933 | - use std::sync::{Arc, Mutex}; |
4934 | + |
4935 | + use crate::{ |
4936 | + email::{ |
4937 | + pgp::{DecryptionMetadata, Recipient}, |
4938 | + Address, |
4939 | + }, |
4940 | + error::{Error, ErrorKind, IntoError, Result, ResultIntoError}, |
4941 | + }; |
4942 | |
4943 | macro_rules! call { |
4944 | ($lib:expr, $func:ty) => {{ |
4945 | @@ -247,10 +255,10 @@ impl Context { |
4946 | |
4947 | let mut io_cbs = gpgme_io_cbs { |
4948 | add: Some(io::gpgme_register_io_cb), |
4949 | - add_priv: Arc::into_raw(add_priv_data) as *mut ::std::os::raw::c_void, //add_priv: *mut ::std::os::raw::c_void, |
4950 | + add_priv: Arc::into_raw(add_priv_data) as *mut ::std::os::raw::c_void, /* add_priv: *mut ::std::os::raw::c_void, */ |
4951 | remove: Some(io::gpgme_remove_io_cb), |
4952 | event: Some(io::gpgme_event_io_cb), |
4953 | - event_priv: Arc::into_raw(event_priv_data) as *mut ::std::os::raw::c_void, //pub event_priv: *mut ::std::os::raw::c_void, |
4954 | + event_priv: Arc::into_raw(event_priv_data) as *mut ::std::os::raw::c_void, /* pub event_priv: *mut ::std::os::raw::c_void, */ |
4955 | }; |
4956 | |
4957 | unsafe { |
4958 | @@ -1345,7 +1353,8 @@ impl Drop for Key { |
4959 | // futures::executor::block_on(ctx.keylist().unwrap()).unwrap() |
4960 | // ); |
4961 | // let cipher = ctx.new_data_file("/tmp/msg.asc").unwrap(); |
4962 | - // let plain = futures::executor::block_on(ctx.decrypt(cipher).unwrap()).unwrap(); |
4963 | + // let plain = |
4964 | + // futures::executor::block_on(ctx.decrypt(cipher).unwrap()).unwrap(); |
4965 | // println!( |
4966 | // "buf: {}", |
4967 | // String::from_utf8_lossy(&plain.into_bytes().unwrap()) |
4968 | diff --git a/melib/src/lib.rs b/melib/src/lib.rs |
4969 | index c50086d..8902d27 100644 |
4970 | --- a/melib/src/lib.rs |
4971 | +++ b/melib/src/lib.rs |
4972 | @@ -20,19 +20,29 @@ |
4973 | */ |
4974 | |
4975 | //! A crate that performs mail client operations such as |
4976 | - //! - Hold an [`Envelope`](./email/struct.Envelope.html) with methods convenient for mail client use. (see module [`email`](./email/index.html)) |
4977 | - //! - Abstract through mail storages through the [`MailBackend`](./backends/trait.MailBackend.html) trait, and handle read/writes/updates through it. (see module [`backends`](./backends/index.html)) |
4978 | - //! - Decode attachments (see module [`email::attachments`](./email/attachments/index.html)) |
4979 | + //! - Hold an [`Envelope`](./email/struct.Envelope.html) with methods convenient |
4980 | + //! for mail client use. (see module [`email`](./email/index.html)) |
4981 | + //! - Abstract through mail storages through the |
4982 | + //! [`MailBackend`](./backends/trait.MailBackend.html) trait, and handle |
4983 | + //! read/writes/updates through it. (see module |
4984 | + //! [`backends`](./backends/index.html)) |
4985 | + //! - Decode attachments (see module |
4986 | + //! [`email::attachments`](./email/attachments/index.html)) |
4987 | //! - Create new mail (see [`email::Draft`](./email/compose/struct.Draft.html)) |
4988 | //! - Send mail with an SMTP client (see module [`smtp`](./smtp/index.html)) |
4989 | - //! - Manage an `addressbook` i.e. have contacts (see module [`addressbook`](./addressbook/index.html)) |
4990 | - //! - Build thread structures out of a list of mail via their `In-Reply-To` and `References` header values (see module [`thread`](./thread/index.html)) |
4991 | + //! - Manage an `addressbook` i.e. have contacts (see module |
4992 | + //! [`addressbook`](./addressbook/index.html)) |
4993 | + //! - Build thread structures out of a list of mail via their `In-Reply-To` and |
4994 | + //! `References` header values (see module [`thread`](./thread/index.html)) |
4995 | //! |
4996 | //! Other exports are |
4997 | - //! - Basic mail account configuration to use with [`backends`](./backends/index.html) (see module [`conf`](./conf/index.html)) |
4998 | + //! - Basic mail account configuration to use with |
4999 | + //! [`backends`](./backends/index.html) (see module |
5000 | + //! [`conf`](./conf/index.html)) |
5001 | //! - Parser combinators (see module [`parsec`](./parsec/index.html)) |
5002 | //! - A `ShellExpandTrait` to expand paths like a shell. |
5003 | - //! - A `debug` macro that works like `std::dbg` but for multiple threads. (see [`debug` macro](./macro.debug.html)) |
5004 | + //! - A `debug` macro that works like `std::dbg` but for multiple threads. (see |
5005 | + //! [`debug` macro](./macro.debug.html)) |
5006 | #[macro_use] |
5007 | pub mod dbg { |
5008 | |
5009 | @@ -102,8 +112,7 @@ pub use datetime::UnixTimestamp; |
5010 | |
5011 | #[macro_use] |
5012 | mod logging; |
5013 | - pub use self::logging::LoggingLevel::*; |
5014 | - pub use self::logging::*; |
5015 | + pub use self::logging::{LoggingLevel::*, *}; |
5016 | |
5017 | pub mod addressbook; |
5018 | pub use addressbook::*; |
5019 | @@ -180,12 +189,15 @@ impl core::fmt::Display for Bytes { |
5020 | pub use shellexpand::ShellExpandTrait; |
5021 | pub mod shellexpand { |
5022 | |
5023 | - use smallvec::SmallVec; |
5024 | - use std::ffi::OsStr; |
5025 | - use std::os::unix::ffi::OsStrExt; |
5026 | #[cfg(not(any(target_os = "netbsd", target_os = "macos")))] |
5027 | use std::os::unix::io::AsRawFd; |
5028 | - use std::path::{Path, PathBuf}; |
5029 | + use std::{ |
5030 | + ffi::OsStr, |
5031 | + os::unix::ffi::OsStrExt, |
5032 | + path::{Path, PathBuf}, |
5033 | + }; |
5034 | + |
5035 | + use smallvec::SmallVec; |
5036 | |
5037 | pub trait ShellExpandTrait { |
5038 | fn expand(&self) -> PathBuf; |
5039 | @@ -233,23 +245,20 @@ pub mod shellexpand { |
5040 | |
5041 | let (prefix, _match) = if self.as_os_str().as_bytes().ends_with(b"/.") { |
5042 | (self.components().as_path(), OsStr::from_bytes(b".")) |
5043 | + } else if self.exists() && (!force || self.as_os_str().as_bytes().ends_with(b"/")) { |
5044 | + return SmallVec::new(); |
5045 | } else { |
5046 | - if self.exists() && (!force || self.as_os_str().as_bytes().ends_with(b"/")) { |
5047 | - // println!("{} {:?}", self.display(), self.components().last()); |
5048 | - return SmallVec::new(); |
5049 | + let last_component = self |
5050 | + .components() |
5051 | + .last() |
5052 | + .map(|c| c.as_os_str()) |
5053 | + .unwrap_or_else(|| OsStr::from_bytes(b"")); |
5054 | + let prefix = if let Some(p) = self.parent() { |
5055 | + p |
5056 | } else { |
5057 | - let last_component = self |
5058 | - .components() |
5059 | - .last() |
5060 | - .map(|c| c.as_os_str()) |
5061 | - .unwrap_or_else(|| OsStr::from_bytes(b"")); |
5062 | - let prefix = if let Some(p) = self.parent() { |
5063 | - p |
5064 | - } else { |
5065 | - return SmallVec::new(); |
5066 | - }; |
5067 | - (prefix, last_component) |
5068 | - } |
5069 | + return SmallVec::new(); |
5070 | + }; |
5071 | + (prefix, last_component) |
5072 | }; |
5073 | |
5074 | let dir = match ::nix::dir::Dir::openat( |
5075 | @@ -322,10 +331,13 @@ pub mod shellexpand { |
5076 | pos += dir[0].d_reclen as usize; |
5077 | } |
5078 | // https://github.com/romkatv/gitstatus/blob/caf44f7aaf33d0f46e6749e50595323c277e0908/src/dir.cc |
5079 | - // "It's tempting to bail here if n + sizeof(linux_dirent64) + 512 <= n. After all, there |
5080 | - // was enough space for another entry but SYS_getdents64 didn't write it, so this must be |
5081 | - // the end of the directory listing, right? Unfortunately, no. SYS_getdents64 is finicky. |
5082 | - // It sometimes writes a partial list of entries even if the full list would fit." |
5083 | + // "It's tempting to bail here if n + sizeof(linux_dirent64) + |
5084 | + // 512 <= n. After all, there was enough space |
5085 | + // for another entry but SYS_getdents64 didn't write it, so this |
5086 | + // must be the end of the directory listing, |
5087 | + // right? Unfortunately, no. SYS_getdents64 is finicky. |
5088 | + // It sometimes writes a partial list of entries even if the |
5089 | + // full list would fit." |
5090 | } |
5091 | entries |
5092 | } |
5093 | @@ -420,8 +432,7 @@ macro_rules! declare_u64_hash { |
5094 | impl $type_name { |
5095 | #[inline(always)] |
5096 | pub fn from_bytes(bytes: &[u8]) -> Self { |
5097 | - use std::collections::hash_map::DefaultHasher; |
5098 | - use std::hash::Hasher; |
5099 | + use std::{collections::hash_map::DefaultHasher, hash::Hasher}; |
5100 | let mut h = DefaultHasher::new(); |
5101 | h.write(bytes); |
5102 | Self(h.finish()) |
5103 | diff --git a/melib/src/logging.rs b/melib/src/logging.rs |
5104 | index 6259b4a..36f9c16 100644 |
5105 | --- a/melib/src/logging.rs |
5106 | +++ b/melib/src/logging.rs |
5107 | @@ -19,11 +19,14 @@ |
5108 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
5109 | */ |
5110 | |
5111 | + use std::{ |
5112 | + fs::OpenOptions, |
5113 | + io::{BufWriter, Write}, |
5114 | + path::PathBuf, |
5115 | + sync::{Arc, Mutex}, |
5116 | + }; |
5117 | + |
5118 | use crate::shellexpand::ShellExpandTrait; |
5119 | - use std::fs::OpenOptions; |
5120 | - use std::io::{BufWriter, Write}; |
5121 | - use std::path::PathBuf; |
5122 | - use std::sync::{Arc, Mutex}; |
5123 | |
5124 | #[derive(Copy, Clone, PartialEq, PartialOrd, Hash, Debug, Serialize, Deserialize)] |
5125 | pub enum LoggingLevel { |
5126 | diff --git a/melib/src/parsec.rs b/melib/src/parsec.rs |
5127 | index c4205b1..a8541c0 100644 |
5128 | --- a/melib/src/parsec.rs |
5129 | +++ b/melib/src/parsec.rs |
5130 | @@ -442,30 +442,17 @@ pub fn is_not<'a>(slice: &'static [u8]) -> impl Parser<'a, &'a str> { |
5131 | /// |
5132 | /// let parser = |input| { |
5133 | /// alt([ |
5134 | - /// delimited( |
5135 | - /// match_literal("{"), |
5136 | - /// quoted_slice(), |
5137 | - /// match_literal("}"), |
5138 | - /// ), |
5139 | - /// delimited( |
5140 | - /// match_literal("["), |
5141 | - /// quoted_slice(), |
5142 | - /// match_literal("]"), |
5143 | - /// ), |
5144 | - /// ]).parse(input) |
5145 | + /// delimited(match_literal("{"), quoted_slice(), match_literal("}")), |
5146 | + /// delimited(match_literal("["), quoted_slice(), match_literal("]")), |
5147 | + /// ]) |
5148 | + /// .parse(input) |
5149 | /// }; |
5150 | /// |
5151 | /// let input1: &str = "{\"quoted\"}"; |
5152 | /// let input2: &str = "[\"quoted\"]"; |
5153 | - /// assert_eq!( |
5154 | - /// Ok(("", "quoted")), |
5155 | - /// parser.parse(input1) |
5156 | - /// ); |
5157 | + /// assert_eq!(Ok(("", "quoted")), parser.parse(input1)); |
5158 | /// |
5159 | - /// assert_eq!( |
5160 | - /// Ok(("", "quoted")), |
5161 | - /// parser.parse(input2) |
5162 | - /// ); |
5163 | + /// assert_eq!(Ok(("", "quoted")), parser.parse(input2)); |
5164 | /// ``` |
5165 | pub fn alt<'a, P, A, const N: usize>(parsers: [P; N]) -> impl Parser<'a, A> |
5166 | where |
5167 | @@ -591,20 +578,17 @@ pub fn take<'a>(count: usize) -> impl Parser<'a, &'a str> { |
5168 | ///```rust |
5169 | /// # use std::str::FromStr; |
5170 | /// # use melib::parsec::{Parser, delimited, match_literal, map_res, is_a, take_literal}; |
5171 | - /// let lit: &str = "{31}\r\nThere is no script by that name\r\n"; |
5172 | - /// assert_eq!( |
5173 | - /// take_literal(delimited( |
5174 | - /// match_literal("{"), |
5175 | - /// map_res(is_a(b"0123456789"), |s| usize::from_str(s)), |
5176 | - /// match_literal("}\r\n"), |
5177 | - /// )) |
5178 | - /// .parse(lit), |
5179 | - /// Ok(( |
5180 | - /// "\r\n", |
5181 | - /// "There is no script by that name", |
5182 | - /// )) |
5183 | - /// ); |
5184 | - ///``` |
5185 | + /// let lit: &str = "{31}\r\nThere is no script by that name\r\n"; |
5186 | + /// assert_eq!( |
5187 | + /// take_literal(delimited( |
5188 | + /// match_literal("{"), |
5189 | + /// map_res(is_a(b"0123456789"), |s| usize::from_str(s)), |
5190 | + /// match_literal("}\r\n"), |
5191 | + /// )) |
5192 | + /// .parse(lit), |
5193 | + /// Ok(("\r\n", "There is no script by that name",)) |
5194 | + /// ); |
5195 | + /// ``` |
5196 | pub fn take_literal<'a, P>(parser: P) -> impl Parser<'a, &'a str> |
5197 | where |
5198 | P: Parser<'a, usize>, |
5199 | @@ -617,9 +601,10 @@ where |
5200 | |
5201 | #[cfg(test)] |
5202 | mod test { |
5203 | - use super::*; |
5204 | use std::collections::HashMap; |
5205 | |
5206 | + use super::*; |
5207 | + |
5208 | #[test] |
5209 | fn test_parsec() { |
5210 | #[derive(Debug, PartialEq)] |
5211 | @@ -639,16 +624,16 @@ mod test { |
5212 | either( |
5213 | either( |
5214 | either( |
5215 | - map(parse_bool(), |b| JsonValue::JsonBool(b)), |
5216 | + map(parse_bool(), JsonValue::JsonBool), |
5217 | map(parse_null(), |()| JsonValue::JsonNull), |
5218 | ), |
5219 | - map(parse_array(), |vec| JsonValue::JsonArray(vec)), |
5220 | + map(parse_array(), JsonValue::JsonArray), |
5221 | ), |
5222 | - map(parse_object(), |obj| JsonValue::JsonObject(obj)), |
5223 | + map(parse_object(), JsonValue::JsonObject), |
5224 | ), |
5225 | - map(parse_number(), |n| JsonValue::JsonNumber(n)), |
5226 | + map(parse_number(), JsonValue::JsonNumber), |
5227 | ), |
5228 | - map(quoted_string(), |s| JsonValue::JsonString(s)), |
5229 | + map(quoted_string(), JsonValue::JsonString), |
5230 | ) |
5231 | .parse(input) |
5232 | } |
5233 | diff --git a/melib/src/search.rs b/melib/src/search.rs |
5234 | index 467d7b0..0693cc7 100644 |
5235 | --- a/melib/src/search.rs |
5236 | +++ b/melib/src/search.rs |
5237 | @@ -19,14 +19,13 @@ |
5238 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
5239 | */ |
5240 | |
5241 | - use crate::parsec::*; |
5242 | - use crate::UnixTimestamp; |
5243 | - use std::borrow::Cow; |
5244 | - use std::convert::TryFrom; |
5245 | + use std::{borrow::Cow, convert::TryFrom}; |
5246 | |
5247 | pub use query_parser::query; |
5248 | use Query::*; |
5249 | |
5250 | + use crate::{parsec::*, UnixTimestamp}; |
5251 | + |
5252 | #[derive(Debug, PartialEq, Clone, Serialize)] |
5253 | pub enum Query { |
5254 | Before(UnixTimestamp), |
5255 | @@ -233,9 +232,10 @@ pub mod query_parser { |
5256 | /// |
5257 | /// # Invocation |
5258 | /// ``` |
5259 | - /// use melib::search::query; |
5260 | - /// use melib::search::Query; |
5261 | - /// use melib::parsec::Parser; |
5262 | + /// use melib::{ |
5263 | + /// parsec::Parser, |
5264 | + /// search::{query, Query}, |
5265 | + /// }; |
5266 | /// |
5267 | /// let input = "test"; |
5268 | /// let query = query().parse(input); |
5269 | diff --git a/melib/src/sieve.rs b/melib/src/sieve.rs |
5270 | index d84e07b..6a66a26 100644 |
5271 | --- a/melib/src/sieve.rs |
5272 | +++ b/melib/src/sieve.rs |
5273 | @@ -153,7 +153,8 @@ pub enum ZoneRule { |
5274 | ///time zone in offset format "+hhmm" or "-hhmm". An |
5275 | ///offset of 0 (Zulu) always has a positive sign. |
5276 | Zone, |
5277 | - /// "weekday" => the day of the week expressed as an integer between "0" and "6". "0" is Sunday, "1" is Monday, etc. |
5278 | + /// "weekday" => the day of the week expressed as an integer between "0" |
5279 | + /// and "6". "0" is Sunday, "1" is Monday, etc. |
5280 | Weekday, |
5281 | } |
5282 | |
5283 | @@ -370,9 +371,9 @@ pub mod parser { |
5284 | ), |
5285 | |(num_s, quant)| { |
5286 | Ok(match (num_s.parse::<u64>(), quant.to_ascii_lowercase()) { |
5287 | - (Ok(num), 'k') => num * 1000, |
5288 | - (Ok(num), 'm') => num * 1000_000, |
5289 | - (Ok(num), 'g') => num * 1000_000_000, |
5290 | + (Ok(num), 'k') => num * 1_000, |
5291 | + (Ok(num), 'm') => num * 1_000_000, |
5292 | + (Ok(num), 'g') => num * 1_000_000_000, |
5293 | _ => return Err(num_s), |
5294 | }) |
5295 | }, |
5296 | @@ -483,7 +484,8 @@ pub mod parser { |
5297 | } |
5298 | } |
5299 | |
5300 | - // address [COMPARATOR] [ADDRESS-PART] [MATCH-TYPE] <header-list: string-list> <key-list: string-list> |
5301 | + // address [COMPARATOR] [ADDRESS-PART] [MATCH-TYPE] <header-list: string-list> |
5302 | + // <key-list: string-list> |
5303 | pub fn parse_sieve_address<'a>() -> impl Parser<'a, ConditionRule> { |
5304 | move |input| { |
5305 | map( |
5306 | @@ -677,19 +679,12 @@ pub mod parser { |
5307 | |
5308 | #[cfg(test)] |
5309 | mod test { |
5310 | - use super::parser::*; |
5311 | + use super::{ |
5312 | + parser::*, ActionCommand::*, AddressOperator::*, CharacterOperator::*, ConditionRule::*, |
5313 | + ControlCommand::*, IntegerOperator::*, MatchOperator::*, Rule::*, RuleBlock, |
5314 | + }; |
5315 | use crate::parsec::Parser; |
5316 | |
5317 | - use super::ActionCommand::*; |
5318 | - use super::AddressOperator::*; |
5319 | - use super::CharacterOperator::*; |
5320 | - use super::ConditionRule::*; |
5321 | - use super::ControlCommand::*; |
5322 | - use super::IntegerOperator::*; |
5323 | - use super::MatchOperator::*; |
5324 | - use super::Rule::*; |
5325 | - use super::RuleBlock; |
5326 | - |
5327 | #[test] |
5328 | fn test_sieve_parse_strings() { |
5329 | assert_eq!( |
5330 | @@ -705,9 +700,10 @@ mod test { |
5331 | |
5332 | #[test] |
5333 | fn test_sieve_parse_conditionals() { |
5334 | - /* Operators that start with : like :matches are unordered and optional, since they have |
5335 | - * defaults. But that means we must handle any order correctly, which is tricky if we use |
5336 | - * an optional parser; for an optional parser both None and Some(_) are valid values. |
5337 | + /* Operators that start with : like :matches are unordered and optional, |
5338 | + * since they have defaults. But that means we must handle any order |
5339 | + * correctly, which is tricky if we use an optional parser; for an |
5340 | + * optional parser both None and Some(_) are valid values. |
5341 | */ |
5342 | |
5343 | /* Permutations of two */ |
5344 | diff --git a/melib/src/smtp.rs b/melib/src/smtp.rs |
5345 | index 1c38411..8f9d1f3 100644 |
5346 | --- a/melib/src/smtp.rs |
5347 | +++ b/melib/src/smtp.rs |
5348 | @@ -24,8 +24,8 @@ |
5349 | |
5350 | //! SMTP client support |
5351 | //! |
5352 | - //! This module implements a client for the SMTP protocol as specified by [RFC 5321 Simple Mail |
5353 | - //! Transfer Protocol](https://www.rfc-editor.org/rfc/rfc5321). |
5354 | + //! This module implements a client for the SMTP protocol as specified by [RFC |
5355 | + //! 5321 Simple Mail Transfer Protocol](https://www.rfc-editor.org/rfc/rfc5321). |
5356 | //! |
5357 | //! The connection and methods are `async` and uses the `smol` runtime. |
5358 | //!# Example |
5359 | @@ -72,18 +72,18 @@ |
5360 | //! Ok(()) |
5361 | //! ``` |
5362 | |
5363 | - use crate::connections::{lookup_ipv4, Connection}; |
5364 | - use crate::email::{parser::BytesExt, Address, Envelope}; |
5365 | - use crate::error::{Error, Result, ResultIntoError}; |
5366 | + use std::{borrow::Cow, convert::TryFrom, net::TcpStream, process::Command}; |
5367 | + |
5368 | use futures::io::{AsyncReadExt, AsyncWriteExt}; |
5369 | use native_tls::TlsConnector; |
5370 | use smallvec::SmallVec; |
5371 | - use smol::unblock; |
5372 | - use smol::Async as AsyncWrapper; |
5373 | - use std::borrow::Cow; |
5374 | - use std::convert::TryFrom; |
5375 | - use std::net::TcpStream; |
5376 | - use std::process::Command; |
5377 | + use smol::{unblock, Async as AsyncWrapper}; |
5378 | + |
5379 | + use crate::{ |
5380 | + connections::{lookup_ipv4, Connection}, |
5381 | + email::{parser::BytesExt, Address, Envelope}, |
5382 | + error::{Error, Result, ResultIntoError}, |
5383 | + }; |
5384 | |
5385 | /// Kind of server security (StartTLS/TLS/None) the client should attempt |
5386 | #[derive(Debug, Copy, PartialEq, Eq, Clone, Serialize, Deserialize)] |
5387 | @@ -191,11 +191,12 @@ pub struct SmtpExtensionSupport { |
5388 | /// [RFC 6152: SMTP Service Extension for 8-bit MIME Transport](https://www.rfc-editor.org/rfc/rfc6152) |
5389 | #[serde(default = "crate::conf::true_val")] |
5390 | _8bitmime: bool, |
5391 | - /// Essentially, the PRDR extension to SMTP allows (but does not require) an SMTP server to |
5392 | - /// issue multiple responses after a message has been transferred, by mutual consent of the |
5393 | - /// client and server. SMTP clients that support the PRDR extension then use the expanded |
5394 | - /// responses as supplemental data to the responses that were received during the earlier |
5395 | - /// envelope exchange. |
5396 | + /// Essentially, the PRDR extension to SMTP allows (but does not require) an |
5397 | + /// SMTP server to issue multiple responses after a message has been |
5398 | + /// transferred, by mutual consent of the client and server. SMTP |
5399 | + /// clients that support the PRDR extension then use the expanded |
5400 | + /// responses as supplemental data to the responses that were received |
5401 | + /// during the earlier envelope exchange. |
5402 | #[serde(default = "crate::conf::true_val")] |
5403 | prdr: bool, |
5404 | #[serde(default = "crate::conf::true_val")] |
5405 | @@ -284,7 +285,10 @@ impl SmtpConnection { |
5406 | danger_accept_invalid_certs, |
5407 | }; |
5408 | } else { |
5409 | - return Err(Error::new("Please specify what SMTP security transport to use explicitly instead of `auto`.")); |
5410 | + return Err(Error::new( |
5411 | + "Please specify what SMTP security transport to use explicitly \ |
5412 | + instead of `auto`.", |
5413 | + )); |
5414 | } |
5415 | } |
5416 | socket.write_all(b"EHLO meli.delivery\r\n").await?; |
5417 | @@ -386,9 +390,11 @@ impl SmtpConnection { |
5418 | .any(|l| l.starts_with("AUTH")) |
5419 | { |
5420 | return Err(Error::new(format!( |
5421 | - "SMTP Server doesn't advertise Authentication support. Server response was: {:?}", |
5422 | - pre_auth_extensions_reply |
5423 | - )).set_kind(crate::error::ErrorKind::Authentication)); |
5424 | + "SMTP Server doesn't advertise Authentication support. Server response was: \ |
5425 | + {:?}", |
5426 | + pre_auth_extensions_reply |
5427 | + )) |
5428 | + .set_kind(crate::error::ErrorKind::Authentication)); |
5429 | } |
5430 | no_auth_needed = |
5431 | ret.server_conf.auth == SmtpAuth::None || !ret.server_conf.auth.require_auth(); |
5432 | @@ -430,7 +436,7 @@ impl SmtpConnection { |
5433 | |
5434 | let mut output = unblock(move || { |
5435 | Command::new("sh") |
5436 | - .args(&["-c", &_command]) |
5437 | + .args(["-c", &_command]) |
5438 | .stdin(std::process::Stdio::piped()) |
5439 | .stdout(std::process::Stdio::piped()) |
5440 | .stderr(std::process::Stdio::piped()) |
5441 | @@ -493,7 +499,7 @@ impl SmtpConnection { |
5442 | let _token_command = token_command.clone(); |
5443 | let mut output = unblock(move || { |
5444 | Command::new("sh") |
5445 | - .args(&["-c", &_token_command]) |
5446 | + .args(["-c", &_token_command]) |
5447 | .stdin(std::process::Stdio::piped()) |
5448 | .stdout(std::process::Stdio::piped()) |
5449 | .stderr(std::process::Stdio::piped()) |
5450 | @@ -538,7 +544,7 @@ impl SmtpConnection { |
5451 | self.server_conf.envelope_from = envelope_from; |
5452 | } |
5453 | |
5454 | - fn set_extension_support(&mut self, reply: Reply<'_>) { |
5455 | + fn set_extension_support(&mut self, reply: Reply) { |
5456 | debug_assert_eq!(reply.code, ReplyCode::_250); |
5457 | self.server_conf.extensions.pipelining &= reply.lines.contains(&"PIPELINING"); |
5458 | self.server_conf.extensions.chunking &= reply.lines.contains(&"CHUNKING"); |
5459 | @@ -595,7 +601,10 @@ impl SmtpConnection { |
5460 | .chain_err_summary(|| "SMTP submission was aborted")?; |
5461 | let tos = tos.unwrap_or_else(|| envelope.to()); |
5462 | if tos.is_empty() && envelope.cc().is_empty() && envelope.bcc().is_empty() { |
5463 | - return Err(Error::new("SMTP submission was aborted because there was no e-mail address found in the To: header field. Consider adding recipients.")); |
5464 | + return Err(Error::new( |
5465 | + "SMTP submission was aborted because there was no e-mail address found in the To: \ |
5466 | + header field. Consider adding recipients.", |
5467 | + )); |
5468 | } |
5469 | let mut current_command: SmallVec<[&[u8]; 16]> = SmallVec::new(); |
5470 | //first step in the procedure is the MAIL command. |
5471 | @@ -605,9 +614,17 @@ impl SmtpConnection { |
5472 | current_command.push(envelope_from.trim().as_bytes()); |
5473 | } else { |
5474 | if envelope.from().is_empty() { |
5475 | - return Err(Error::new("SMTP submission was aborted because there was no e-mail address found in the From: header field. Consider adding a valid value or setting `envelope_from` in SMTP client settings")); |
5476 | + return Err(Error::new( |
5477 | + "SMTP submission was aborted because there was no e-mail address found in the \ |
5478 | + From: header field. Consider adding a valid value or setting `envelope_from` \ |
5479 | + in SMTP client settings", |
5480 | + )); |
5481 | } else if envelope.from().len() != 1 { |
5482 | - return Err(Error::new("SMTP submission was aborted because there was more than one e-mail address found in the From: header field. Consider setting `envelope_from` in SMTP client settings")); |
5483 | + return Err(Error::new( |
5484 | + "SMTP submission was aborted because there was more than one e-mail address \ |
5485 | + found in the From: header field. Consider setting `envelope_from` in SMTP \ |
5486 | + client settings", |
5487 | + )); |
5488 | } |
5489 | current_command.push(envelope.from()[0].address_spec_raw().trim()); |
5490 | } |
5491 | @@ -628,12 +645,13 @@ impl SmtpConnection { |
5492 | } else { |
5493 | pipelining_queue.push(Some((ReplyCode::_250, &[]))); |
5494 | } |
5495 | - //The second step in the procedure is the RCPT command. This step of the procedure can |
5496 | - //be repeated any number of times. If accepted, the SMTP server returns a "250 OK" |
5497 | - //reply. If the mailbox specification is not acceptable for some reason, the server MUST |
5498 | - //return a reply indicating whether the failure is permanent (i.e., will occur again if |
5499 | - //the client tries to send the same address again) or temporary (i.e., the address might |
5500 | - //be accepted if the client tries again later). |
5501 | + //The second step in the procedure is the RCPT command. This step of the |
5502 | + // procedure can be repeated any number of times. If accepted, the SMTP |
5503 | + // server returns a "250 OK" reply. If the mailbox specification is not |
5504 | + // acceptable for some reason, the server MUST return a reply indicating |
5505 | + // whether the failure is permanent (i.e., will occur again if |
5506 | + // the client tries to send the same address again) or temporary (i.e., the |
5507 | + // address might be accepted if the client tries again later). |
5508 | for addr in tos |
5509 | .iter() |
5510 | .chain(envelope.cc().iter()) |
5511 | @@ -651,7 +669,8 @@ impl SmtpConnection { |
5512 | self.send_command(¤t_command).await?; |
5513 | |
5514 | //RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF> |
5515 | - //If accepted, the SMTP server returns a "250 OK" reply and stores the forward-path. |
5516 | + //If accepted, the SMTP server returns a "250 OK" reply and stores the |
5517 | + // forward-path. |
5518 | if !self.server_conf.extensions.pipelining { |
5519 | self.read_lines(&mut res, Some((ReplyCode::_250, &[]))) |
5520 | .await?; |
5521 | @@ -660,9 +679,10 @@ impl SmtpConnection { |
5522 | } |
5523 | } |
5524 | |
5525 | - //Since it has been a common source of errors, it is worth noting that spaces are not |
5526 | - //permitted on either side of the colon following FROM in the MAIL command or TO in the |
5527 | - //RCPT command. The syntax is exactly as given above. |
5528 | + //Since it has been a common source of errors, it is worth noting that spaces |
5529 | + // are not permitted on either side of the colon following FROM in the |
5530 | + // MAIL command or TO in the RCPT command. The syntax is exactly as |
5531 | + // given above. |
5532 | |
5533 | if self.server_conf.extensions.binarymime { |
5534 | let mail_length = format!("{}", mail.as_bytes().len()); |
5535 | @@ -674,13 +694,14 @@ impl SmtpConnection { |
5536 | //(or some alternative specified in a service extension). |
5537 | //DATA <CRLF> |
5538 | self.send_command(&[b"DATA"]).await?; |
5539 | - //Client SMTP implementations that employ pipelining MUST check ALL statuses associated |
5540 | - //with each command in a group. For example, if none of the RCPT TO recipient addresses |
5541 | - //were accepted the client must then check the response to the DATA command -- the client |
5542 | - //cannot assume that the DATA command will be rejected just because none of the RCPT TO |
5543 | - //commands worked. If the DATA command was properly rejected the client SMTP can just |
5544 | - //issue RSET, but if the DATA command was accepted the client SMTP should send a single |
5545 | - //dot. |
5546 | + //Client SMTP implementations that employ pipelining MUST check ALL statuses |
5547 | + // associated with each command in a group. For example, if none of |
5548 | + // the RCPT TO recipient addresses were accepted the client must |
5549 | + // then check the response to the DATA command -- the client |
5550 | + // cannot assume that the DATA command will be rejected just because none of the |
5551 | + // RCPT TO commands worked. If the DATA command was properly |
5552 | + // rejected the client SMTP can just issue RSET, but if the DATA |
5553 | + // command was accepted the client SMTP should send a single dot. |
5554 | let mut _all_error = self.server_conf.extensions.pipelining; |
5555 | let mut _any_error = false; |
5556 | let mut ignore_mailfrom = true; |
5557 | @@ -694,15 +715,17 @@ impl SmtpConnection { |
5558 | pipelining_results.push(reply.into()); |
5559 | } |
5560 | |
5561 | - //If accepted, the SMTP server returns a 354 Intermediate reply and considers all |
5562 | - //succeeding lines up to but not including the end of mail data indicator to be the |
5563 | - //message text. When the end of text is successfully received and stored, the |
5564 | - //SMTP-receiver sends a "250 OK" reply. |
5565 | + //If accepted, the SMTP server returns a 354 Intermediate reply and considers |
5566 | + // all succeeding lines up to but not including the end of mail data |
5567 | + // indicator to be the message text. When the end of text is |
5568 | + // successfully received and stored, the SMTP-receiver sends a "250 |
5569 | + // OK" reply. |
5570 | self.read_lines(&mut res, Some((ReplyCode::_354, &[]))) |
5571 | .await?; |
5572 | |
5573 | - //Before sending a line of mail text, the SMTP client checks the first character of the |
5574 | - //line.If it is a period, one additional period is inserted at the beginning of the line. |
5575 | + //Before sending a line of mail text, the SMTP client checks the first |
5576 | + // character of the line.If it is a period, one additional period is |
5577 | + // inserted at the beginning of the line. |
5578 | for line in mail.lines() { |
5579 | if line.starts_with('.') { |
5580 | self.stream.write_all(b".").await?; |
5581 | @@ -715,15 +738,16 @@ impl SmtpConnection { |
5582 | self.stream.write_all(b".\r\n").await?; |
5583 | } |
5584 | |
5585 | - //The mail data are terminated by a line containing only a period, that is, the character |
5586 | - //sequence "<CRLF>.<CRLF>", where the first <CRLF> is actually the terminator of the |
5587 | - //previous line (see Section 4.5.2). This is the end of mail data indication. |
5588 | + //The mail data are terminated by a line containing only a period, that is, the |
5589 | + // character sequence "<CRLF>.<CRLF>", where the first <CRLF> is |
5590 | + // actually the terminator of the previous line (see Section 4.5.2). |
5591 | + // This is the end of mail data indication. |
5592 | self.stream.write_all(b".\r\n").await?; |
5593 | } |
5594 | |
5595 | - //The end of mail data indicator also confirms the mail transaction and tells the SMTP |
5596 | - //server to now process the stored recipients and mail data. If accepted, the SMTP |
5597 | - //server returns a "250 OK" reply. |
5598 | + //The end of mail data indicator also confirms the mail transaction and tells |
5599 | + // the SMTP server to now process the stored recipients and mail data. |
5600 | + // If accepted, the SMTP server returns a "250 OK" reply. |
5601 | let reply_code = self |
5602 | .read_lines( |
5603 | &mut res, |
5604 | @@ -760,7 +784,9 @@ pub type ExpectedReplyCode = Option<(ReplyCode, &'static [ReplyCode])>; |
5605 | pub enum ReplyCode { |
5606 | /// System status, or system help reply |
5607 | _211, |
5608 | - /// Help message (Information on how to use the receiver or the meaning of a particular non-standard command; this reply is useful only to the human user) |
5609 | + /// Help message (Information on how to use the receiver or the meaning of a |
5610 | + /// particular non-standard command; this reply is useful only to the human |
5611 | + /// user) |
5612 | _214, |
5613 | /// <domain> Service ready |
5614 | _220, |
5615 | @@ -772,7 +798,8 @@ pub enum ReplyCode { |
5616 | _250, |
5617 | /// User not local; will forward to <forward-path> (See Section 3.4) |
5618 | _251, |
5619 | - /// Cannot VRFY user, but will accept message and attempt delivery (See Section 3.5.3) |
5620 | + /// Cannot VRFY user, but will accept message and attempt delivery (See |
5621 | + /// Section 3.5.3) |
5622 | _252, |
5623 | /// rfc4954 AUTH continuation request |
5624 | _334, |
5625 | @@ -780,9 +807,11 @@ pub enum ReplyCode { |
5626 | _353, |
5627 | /// Start mail input; end with <CRLF>.<CRLF> |
5628 | _354, |
5629 | - /// <domain> Service not available, closing transmission channel (This may be a reply to any command if the service knows it must shut down) |
5630 | + /// <domain> Service not available, closing transmission channel (This may |
5631 | + /// be a reply to any command if the service knows it must shut down) |
5632 | _421, |
5633 | - /// Requested mail action not taken: mailbox unavailable (e.g., mailbox busy or temporarily blocked for policy reasons) |
5634 | + /// Requested mail action not taken: mailbox unavailable (e.g., mailbox busy |
5635 | + /// or temporarily blocked for policy reasons) |
5636 | _450, |
5637 | /// Requested action aborted: local error in processing |
5638 | _451, |
5639 | @@ -790,7 +819,8 @@ pub enum ReplyCode { |
5640 | _452, |
5641 | /// Server unable to accommodate parameters |
5642 | _455, |
5643 | - /// Syntax error, command unrecognized (This may include errors such as command line too long) |
5644 | + /// Syntax error, command unrecognized (This may include errors such as |
5645 | + /// command line too long) |
5646 | _500, |
5647 | /// Syntax error in parameters or arguments |
5648 | _501, |
5649 | @@ -802,15 +832,18 @@ pub enum ReplyCode { |
5650 | _504, |
5651 | /// Authentication failed |
5652 | _535, |
5653 | - /// Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons) |
5654 | + /// Requested action not taken: mailbox unavailable (e.g., mailbox not |
5655 | + /// found, no access, or command rejected for policy reasons) |
5656 | _550, |
5657 | /// User not local; please try <forward-path> (See Section 3.4) |
5658 | _551, |
5659 | /// Requested mail action aborted: exceeded storage allocation |
5660 | _552, |
5661 | - /// Requested action not taken: mailbox name not allowed (e.g., mailbox syntax incorrect) |
5662 | + /// Requested action not taken: mailbox name not allowed (e.g., mailbox |
5663 | + /// syntax incorrect) |
5664 | _553, |
5665 | - /// Transaction failed (Or, in the case of a connection-opening response, "No SMTP service here") |
5666 | + /// Transaction failed (Or, in the case of a connection-opening response, |
5667 | + /// "No SMTP service here") |
5668 | _554, |
5669 | /// MAIL FROM/RCPT TO parameters not recognized or not implemented |
5670 | _555, |
5671 | @@ -844,10 +877,16 @@ impl ReplyCode { |
5672 | _503 => "Bad sequence of commands", |
5673 | _504 => "Command parameter not implemented", |
5674 | _535 => "Authentication failed", |
5675 | - _550 => "Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons)", |
5676 | + _550 => { |
5677 | + "Requested action not taken: mailbox unavailable (e.g., mailbox not found, no \ |
5678 | + access, or command rejected for policy reasons)" |
5679 | + } |
5680 | _551 => "User not local", |
5681 | _552 => "Requested mail action aborted: exceeded storage allocation", |
5682 | - _553 => "Requested action not taken: mailbox name not allowed (e.g., mailbox syntax incorrect)", |
5683 | + _553 => { |
5684 | + "Requested action not taken: mailbox name not allowed (e.g., mailbox syntax \ |
5685 | + incorrect)" |
5686 | + } |
5687 | _554 => "Transaction failed", |
5688 | _555 => "MAIL FROM/RCPT TO parameters not recognized or not implemented", |
5689 | _530 => "Must issue a STARTTLS command first", |
5690 | @@ -927,19 +966,19 @@ pub struct Reply<'s> { |
5691 | pub lines: SmallVec<[&'s str; 16]>, |
5692 | } |
5693 | |
5694 | - impl<'s> Into<Result<ReplyCode>> for Reply<'s> { |
5695 | - fn into(self: Reply<'s>) -> Result<ReplyCode> { |
5696 | - if self.code.is_err() { |
5697 | - Err(Error::new(self.lines.join("\n")).set_summary(self.code.as_str())) |
5698 | + impl<'s> From<Reply<'s>> for Result<ReplyCode> { |
5699 | + fn from(val: Reply<'s>) -> Self { |
5700 | + if val.code.is_err() { |
5701 | + Err(Error::new(val.lines.join("\n")).set_summary(val.code.as_str())) |
5702 | } else { |
5703 | - Ok(self.code) |
5704 | + Ok(val.code) |
5705 | } |
5706 | } |
5707 | } |
5708 | |
5709 | impl<'s> Reply<'s> { |
5710 | - /// `s` must be raw SMTP output i.e each line must start with 3 digit reply code, a space |
5711 | - /// or '-' and end with '\r\n' |
5712 | + /// `s` must be raw SMTP output i.e each line must start with 3 digit reply |
5713 | + /// code, a space or '-' and end with '\r\n' |
5714 | pub fn new(s: &'s str, code: ReplyCode) -> Self { |
5715 | let lines: SmallVec<_> = s.lines().map(|l| &l[4..l.len()]).collect(); |
5716 | Reply { lines, code } |
5717 | @@ -959,7 +998,9 @@ async fn read_lines<'r>( |
5718 | let mut returned_code: Option<ReplyCode> = None; |
5719 | 'read_loop: loop { |
5720 | while let Some(pos) = ret[last_line_idx..].find("\r\n") { |
5721 | - // "Formally, a reply is defined to be the sequence: a three-digit code, <SP>, one line of text, and <CRLF>, or a multiline reply (as defined in the same section)." |
5722 | + // "Formally, a reply is defined to be the sequence: a three-digit code, <SP>, |
5723 | + // one line of text, and <CRLF>, or a multiline reply (as defined in the same |
5724 | + // section)." |
5725 | if ret[last_line_idx..].len() < 4 |
5726 | || !ret[last_line_idx..] |
5727 | .chars() |
5728 | @@ -1022,12 +1063,15 @@ async fn read_lines<'r>( |
5729 | |
5730 | #[cfg(test)] |
5731 | mod test { |
5732 | - use super::*; |
5733 | + use std::net::IpAddr; //, Ipv4Addr, Ipv6Addr}; |
5734 | + use std::{ |
5735 | + sync::{Arc, Mutex}, |
5736 | + thread, |
5737 | + }; |
5738 | |
5739 | use mailin_embedded::{Handler, Response, Server, SslConfig}; |
5740 | - use std::net::IpAddr; //, Ipv4Addr, Ipv6Addr}; |
5741 | - use std::sync::{Arc, Mutex}; |
5742 | - use std::thread; |
5743 | + |
5744 | + use super::*; |
5745 | |
5746 | const ADDRESS: &str = "127.0.0.1:8825"; |
5747 | #[derive(Debug, Clone)] |
5748 | @@ -1229,7 +1273,7 @@ mod test { |
5749 | futures::executor::block_on(SmtpConnection::new_connection(smtp_server_conf)).unwrap(); |
5750 | futures::executor::block_on(connection.mail_transaction( |
5751 | input_str, |
5752 | - /*tos*/ |
5753 | + /* tos */ |
5754 | Some(&[ |
5755 | Address::try_from("foo-chat@example.com").unwrap(), |
5756 | Address::try_from("webmaster@example.com").unwrap(), |
5757 | diff --git a/melib/src/sqlite3.rs b/melib/src/sqlite3.rs |
5758 | index a8177d4..9c6995b 100644 |
5759 | --- a/melib/src/sqlite3.rs |
5760 | +++ b/melib/src/sqlite3.rs |
5761 | @@ -19,10 +19,12 @@ |
5762 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
5763 | */ |
5764 | |
5765 | - use crate::{error::*, logging::log, Envelope}; |
5766 | + use std::path::PathBuf; |
5767 | + |
5768 | use rusqlite::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput}; |
5769 | pub use rusqlite::{self, params, Connection}; |
5770 | - use std::path::PathBuf; |
5771 | + |
5772 | + use crate::{error::*, logging::log, Envelope}; |
5773 | |
5774 | #[derive(Copy, Clone, Debug)] |
5775 | pub struct DatabaseDescription { |
5776 | @@ -90,8 +92,9 @@ pub fn open_or_create_db( |
5777 | ); |
5778 | if second_try { |
5779 | return Err(Error::new(format!( |
5780 | - "Database version mismatch, is {} but expected {}. Could not recreate database.", |
5781 | - version, description.version |
5782 | + "Database version mismatch, is {} but expected {}. Could not recreate \ |
5783 | + database.", |
5784 | + version, description.version |
5785 | ))); |
5786 | } |
5787 | reset_db(description, identifier)?; |
5788 | @@ -100,7 +103,7 @@ pub fn open_or_create_db( |
5789 | } |
5790 | |
5791 | if version == 0 { |
5792 | - conn.pragma_update(None, "user_version", &description.version)?; |
5793 | + conn.pragma_update(None, "user_version", description.version)?; |
5794 | } |
5795 | if let Some(s) = description.init_script { |
5796 | conn.execute_batch(s) |
5797 | diff --git a/melib/src/text_processing/grapheme_clusters.rs b/melib/src/text_processing/grapheme_clusters.rs |
5798 | index e74cf7e..069417e 100644 |
5799 | --- a/melib/src/text_processing/grapheme_clusters.rs |
5800 | +++ b/melib/src/text_processing/grapheme_clusters.rs |
5801 | @@ -29,8 +29,10 @@ |
5802 | |
5803 | */ |
5804 | |
5805 | - use super::types::Reflow; |
5806 | - use super::wcwidth::{wcwidth, CodePointsIter}; |
5807 | + use super::{ |
5808 | + types::Reflow, |
5809 | + wcwidth::{wcwidth, CodePointsIter}, |
5810 | + }; |
5811 | extern crate unicode_segmentation; |
5812 | use self::unicode_segmentation::UnicodeSegmentation; |
5813 | |
5814 | @@ -187,12 +189,13 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5815 | //} |
5816 | // |
5817 | //fn is_surrogate(s: &str, pos: usize) -> bool { |
5818 | - // return 0xd800 <= char_code_at(s, pos) && char_code_at(s, pos) <= 0xdbff && |
5819 | - // 0xdc00 <= char_code_at(s, pos + 1) && char_code_at(s, pos + 1) <= 0xdfff; |
5820 | + // return 0xd800 <= char_code_at(s, pos) && char_code_at(s, pos) <= 0xdbff |
5821 | + // && 0xdc00 <= char_code_at(s, pos + 1) && char_code_at(s, pos + 1) <= |
5822 | + // 0xdfff; |
5823 | //} |
5824 | // |
5825 | - //// Private function, gets a Unicode code point from a java_script UTF-16 string |
5826 | - //// handling surrogate pairs appropriately |
5827 | + //// Private function, gets a Unicode code point from a java_script UTF-16 |
5828 | + //// string handling surrogate pairs appropriately |
5829 | //fn code_point_at(s: &str, idx: usize) -> u8 { |
5830 | // let mut code: u8 = char_code_at(s, idx); |
5831 | // |
5832 | @@ -234,8 +237,8 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5833 | // // GB10. (E_Base | EBG) Extend* ? E_Modifier |
5834 | // let mut e_modifier_index = all.last_index_of(E_Modifier) |
5835 | // if(e_modifier_index > 1 && |
5836 | - // all.slice(1, e_modifier_index).every(function(c){return c == Extend}) && |
5837 | - // [Extend, E_Base, E_Base_GAZ].index_of(start) == -1){ |
5838 | + // all.slice(1, e_modifier_index).every(function(c){return c == |
5839 | + // Extend}) && [Extend, E_Base, E_Base_GAZ].index_of(start) == -1){ |
5840 | // return Break |
5841 | // } |
5842 | // |
5843 | @@ -244,9 +247,10 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5844 | // // GB13. [^RI] (RI RI)* RI ? RI |
5845 | // let mut r_iIndex = all.last_index_of(Regional_Indicator) |
5846 | // if(r_iIndex > 0 && |
5847 | - // all.slice(1, r_iIndex).every(function(c){return c == Regional_Indicator}) && |
5848 | - // [Prepend, Regional_Indicator].index_of(previous) == -1) { |
5849 | - // if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { |
5850 | + // all.slice(1, r_iIndex).every(function(c){return c == |
5851 | + // Regional_Indicator}) && [Prepend, |
5852 | + // Regional_Indicator].index_of(previous) == -1) { |
5853 | + // if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { |
5854 | // return BreakLastRegional |
5855 | // } |
5856 | // else { |
5857 | @@ -300,10 +304,11 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5858 | // } |
5859 | // |
5860 | // // GB10. (E_Base | EBG) Extend* ? E_Modifier |
5861 | - // let mut previous_non_extend_index = all.index_of(Extend) != -1 ? all.last_index_of(Extend) - 1 : all.length - 2; |
5862 | - // if([E_Base, E_Base_GAZ].index_of(all[previous_non_extend_index]) != -1 && |
5863 | - // all.slice(previous_non_extend_index + 1, -1).every(function(c){return c == Extend}) && |
5864 | - // next == E_Modifier){ |
5865 | + // let mut previous_non_extend_index = all.index_of(Extend) != -1 ? |
5866 | + // all.last_index_of(Extend) - 1 : all.length - 2; if([E_Base, |
5867 | + // E_Base_GAZ].index_of(all[previous_non_extend_index]) != -1 && |
5868 | + // all.slice(previous_non_extend_index + 1, -1).every(function(c){return c |
5869 | + // == Extend}) && next == E_Modifier){ |
5870 | // return NotBreak; |
5871 | // } |
5872 | // |
5873 | @@ -388,8 +393,8 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5874 | //// return { value: undefined, done: true }; |
5875 | //// }).bind(this) |
5876 | //// }; |
5877 | - //// // ES2015 @@iterator method (iterable) for spread syntax and for...of statement |
5878 | - //// if (typeof Symbol !== 'undefined' && Symbol.iterator) { |
5879 | + //// // ES2015 @@iterator method (iterable) for spread syntax and for...of |
5880 | + //// statement if (typeof Symbol !== 'undefined' && Symbol.iterator) { |
5881 | //// res[Symbol.iterator] = function() {return res}; |
5882 | //// } |
5883 | //// return res; |
5884 | @@ -419,17 +424,18 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5885 | // //and adapted to java_script rules |
5886 | // |
5887 | // if( |
5888 | - // (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE |
5889 | - // 0x06DD == code || // Cf ARABIC END OF AYAH |
5890 | - // 0x070F == code || // Cf SYRIAC ABBREVIATION MARK |
5891 | + // (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER |
5892 | + // SIGN..ARABIC NUMBER MARK ABOVE 0x06DD == code || // Cf ARABIC |
5893 | + // END OF AYAH 0x070F == code || // Cf SYRIAC ABBREVIATION MARK |
5894 | // 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH |
5895 | // 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH |
5896 | // 0x110BD == code || // Cf KAITHI NUMBER SIGN |
5897 | - // (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA |
5898 | - // 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA |
5899 | - // (0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA |
5900 | - // 0x11D46 == code // Lo MASARAM GONDI REPHA |
5901 | - // ){ |
5902 | + // (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN |
5903 | + // JIHVAMULIYA..SHARADA SIGN UPADHMANIYA 0x11A3A == code || // Lo |
5904 | + // ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA (0x11A86 <= code && code <= |
5905 | + // 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO |
5906 | + // CLUSTER-INITIAL LETTER SA 0x11D46 == code // Lo MASARAM GONDI |
5907 | + // REPHA ){ |
5908 | // return Prepend; |
5909 | // } |
5910 | // if( |
5911 | @@ -446,549 +452,679 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
5912 | // |
5913 | // |
5914 | // if( |
5915 | - // (0x0000 <= code && code <= 0x0009) || // Cc [10] <control-0000>..<control-0009> |
5916 | - // (0x000B <= code && code <= 0x000C) || // Cc [2] <control-000B>..<control-000C> |
5917 | - // (0x000E <= code && code <= 0x001F) || // Cc [18] <control-000E>..<control-001F> |
5918 | - // (0x007F <= code && code <= 0x009F) || // Cc [33] <control-007F>..<control-009F> |
5919 | + // (0x0000 <= code && code <= 0x0009) || // Cc [10] |
5920 | + // <control-0000>..<control-0009> (0x000B <= code && code <= 0x000C) || |
5921 | + // // Cc [2] <control-000B>..<control-000C> (0x000E <= code && code <= |
5922 | + // 0x001F) || // Cc [18] <control-000E>..<control-001F> (0x007F <= code |
5923 | + // && code <= 0x009F) || // Cc [33] <control-007F>..<control-009F> |
5924 | // 0x00AD == code || // Cf SOFT HYPHEN |
5925 | // 0x061C == code || // Cf ARABIC LETTER MARK |
5926 | // |
5927 | // 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR |
5928 | // 0x200B == code || // Cf ZERO WIDTH SPACE |
5929 | - // (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK |
5930 | - // 0x2028 == code || // Zl LINE SEPARATOR |
5931 | + // (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT |
5932 | + // MARK..RIGHT-TO-LEFT MARK 0x2028 == code || // Zl LINE SEPARATOR |
5933 | // 0x2029 == code || // Zp PARAGRAPH SEPARATOR |
5934 | - // (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE |
5935 | - // (0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS |
5936 | - // 0x2065 == code || // Cn <reserved-2065> |
5937 | - // (0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES |
5938 | - // (0x_d800 <= code && code <= 0x_dFFF) || // Cs [2048] <surrogate-D800>..<surrogate-DFFF> |
5939 | - // 0x_fEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE |
5940 | - // (0x_fFF0 <= code && code <= 0x_fFF8) || // Cn [9] <reserved-FFF0>..<reserved-FFF8> |
5941 | - // (0x_fFF9 <= code && code <= 0x_fFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR |
5942 | - // (0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP |
5943 | - // (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE |
5944 | - // 0x_e0000 == code || // Cn <reserved-E0000> |
5945 | - // 0x_e0001 == code || // Cf LANGUAGE TAG |
5946 | - // (0x_e0002 <= code && code <= 0x_e001F) || // Cn [30] <reserved-E0002>..<reserved-E001F> |
5947 | - // (0x_e0080 <= code && code <= 0x_e00FF) || // Cn [128] <reserved-E0080>..<reserved-E00FF> |
5948 | - // (0x_e01F0 <= code && code <= 0x_e0FFF) // Cn [3600] <reserved-E01F0>..<reserved-E0FFF> |
5949 | + // (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT |
5950 | + // EMBEDDING..RIGHT-TO-LEFT OVERRIDE (0x2060 <= code && code <= 0x2064) |
5951 | + // || // Cf [5] WORD JOINER..INVISIBLE PLUS 0x2065 == code || // Cn |
5952 | + // <reserved-2065> (0x2066 <= code && code <= 0x206F) || // Cf [10] |
5953 | + // LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES (0x_d800 <= code && code |
5954 | + // <= 0x_dFFF) || // Cs [2048] <surrogate-D800>..<surrogate-DFFF> 0x_fEFF |
5955 | + // == code || // Cf ZERO WIDTH NO-BREAK SPACE (0x_fFF0 <= code && |
5956 | + // code <= 0x_fFF8) || // Cn [9] <reserved-FFF0>..<reserved-FFF8> |
5957 | + // (0x_fFF9 <= code && code <= 0x_fFFB) || // Cf [3] INTERLINEAR |
5958 | + // ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR (0x1BCA0 <= code |
5959 | + // && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND |
5960 | + // FORMAT UP STEP (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] |
5961 | + // MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE 0x_e0000 == code |
5962 | + // || // Cn <reserved-E0000> 0x_e0001 == code || // Cf |
5963 | + // LANGUAGE TAG (0x_e0002 <= code && code <= 0x_e001F) || // Cn [30] |
5964 | + // <reserved-E0002>..<reserved-E001F> (0x_e0080 <= code && code <= |
5965 | + // 0x_e00FF) || // Cn [128] <reserved-E0080>..<reserved-E00FF> (0x_e01F0 |
5966 | + // <= code && code <= 0x_e0FFF) // Cn [3600] <reserved-E01F0>..<reserved-E0FFF> |
5967 | // ){ |
5968 | // return Control; |
5969 | // } |
5970 | // |
5971 | // |
5972 | // if( |
5973 | - // (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X |
5974 | - // (0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE |
5975 | - // (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN |
5976 | - // (0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG |
5977 | - // 0x05BF == code || // Mn HEBREW POINT RAFE |
5978 | - // (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT |
5979 | - // (0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT |
5980 | - // 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN |
5981 | - // (0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA |
5982 | - // (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW |
5983 | - // 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF |
5984 | - // (0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN |
5985 | - // (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA |
5986 | - // (0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON |
5987 | - // (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM |
5988 | - // 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH |
5989 | - // (0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH |
5990 | - // (0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN |
5991 | - // (0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE |
5992 | - // (0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH |
5993 | - // (0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A |
5994 | - // (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U |
5995 | - // (0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA |
5996 | - // (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK |
5997 | - // (0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA |
5998 | - // (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA |
5999 | - // 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE |
6000 | - // 0x093C == code || // Mn DEVANAGARI SIGN NUKTA |
6001 | - // (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI |
6002 | - // 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA |
6003 | - // (0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE |
6004 | - // (0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL |
6005 | - // 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU |
6006 | - // 0x09BC == code || // Mn BENGALI SIGN NUKTA |
6007 | - // 0x09BE == code || // Mc BENGALI VOWEL SIGN AA |
6008 | - // (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR |
6009 | - // 0x09CD == code || // Mn BENGALI SIGN VIRAMA |
6010 | - // 0x09D7 == code || // Mc BENGALI AU LENGTH MARK |
6011 | - // (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL |
6012 | - // (0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI |
6013 | + // (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE |
6014 | + // ACCENT..COMBINING LATIN SMALL LETTER X (0x0483 <= code && code <= |
6015 | + // 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE |
6016 | + // (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC |
6017 | + // HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN (0x0591 <= |
6018 | + // code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT |
6019 | + // METEG 0x05BF == code || // Mn HEBREW POINT RAFE |
6020 | + // (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN |
6021 | + // DOT..HEBREW POINT SIN DOT (0x05C4 <= code && code <= 0x05C5) || // Mn |
6022 | + // [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT 0x05C7 == code || // |
6023 | + // Mn HEBREW POINT QAMATS QATAN (0x0610 <= code && code <= 0x061A) |
6024 | + // || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA |
6025 | + // (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC |
6026 | + // FATHATAN..ARABIC WAVY HAMZA BELOW 0x0670 == code || // Mn ARABIC |
6027 | + // LETTER SUPERSCRIPT ALEF (0x06D6 <= code && code <= 0x06DC) || // Mn |
6028 | + // [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL |
6029 | + // HIGH SEEN (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC |
6030 | + // SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA (0x06E7 <= code && |
6031 | + // code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON |
6032 | + // (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE |
6033 | + // LOW STOP..ARABIC SMALL LOW MEEM 0x0711 == code || // Mn SYRIAC |
6034 | + // LETTER SUPERSCRIPT ALAPH (0x0730 <= code && code <= 0x074A) || // Mn |
6035 | + // [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH (0x07A6 <= code && code <= |
6036 | + // 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN (0x07EB <= code && |
6037 | + // code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING |
6038 | + // DOUBLE DOT ABOVE (0x0816 <= code && code <= 0x0819) || // Mn [4] |
6039 | + // SAMARITAN MARK IN..SAMARITAN MARK DAGESH (0x081B <= code && code <= |
6040 | + // 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A |
6041 | + // (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN |
6042 | + // SHORT A..SAMARITAN VOWEL SIGN U (0x0829 <= code && code <= 0x082D) || |
6043 | + // // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA |
6044 | + // (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION |
6045 | + // MARK..MANDAIC GEMINATION MARK (0x08D4 <= code && code <= 0x08E1) || // |
6046 | + // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA |
6047 | + // (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA |
6048 | + // BELOW..DEVANAGARI SIGN ANUSVARA 0x093A == code || // Mn |
6049 | + // DEVANAGARI VOWEL SIGN OE 0x093C == code || // Mn DEVANAGARI SIGN |
6050 | + // NUKTA (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI |
6051 | + // VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI 0x094D == code || // Mn |
6052 | + // DEVANAGARI SIGN VIRAMA (0x0951 <= code && code <= 0x0957) || // Mn |
6053 | + // [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE (0x0962 |
6054 | + // <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC |
6055 | + // L..DEVANAGARI VOWEL SIGN VOCALIC LL 0x0981 == code || // Mn |
6056 | + // BENGALI SIGN CANDRABINDU 0x09BC == code || // Mn BENGALI SIGN |
6057 | + // NUKTA 0x09BE == code || // Mc BENGALI VOWEL SIGN AA |
6058 | + // (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN |
6059 | + // U..BENGALI VOWEL SIGN VOCALIC RR 0x09CD == code || // Mn BENGALI |
6060 | + // SIGN VIRAMA 0x09D7 == code || // Mc BENGALI AU LENGTH MARK |
6061 | + // (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN |
6062 | + // VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL (0x0A01 <= code && code <= |
6063 | + // 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI |
6064 | // 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA |
6065 | - // (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU |
6066 | - // (0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI |
6067 | - // (0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA |
6068 | + // (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN |
6069 | + // U..GURMUKHI VOWEL SIGN UU (0x0A47 <= code && code <= 0x0A48) || // Mn |
6070 | + // [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI (0x0A4B <= code && |
6071 | + // code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA |
6072 | // 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT |
6073 | - // (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK |
6074 | - // 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH |
6075 | - // (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA |
6076 | - // 0x0ABC == code || // Mn GUJARATI SIGN NUKTA |
6077 | - // (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E |
6078 | - // (0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI |
6079 | + // (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI |
6080 | + // TIPPI..GURMUKHI ADDAK 0x0A75 == code || // Mn GURMUKHI SIGN |
6081 | + // YAKASH (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN |
6082 | + // CANDRABINDU..GUJARATI SIGN ANUSVARA 0x0ABC == code || // Mn |
6083 | + // GUJARATI SIGN NUKTA (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] |
6084 | + // GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E (0x0AC7 <= code && |
6085 | + // code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI |
6086 | // 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA |
6087 | - // (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL |
6088 | - // (0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE |
6089 | - // 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU |
6090 | + // (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN |
6091 | + // VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL (0x0AFA <= code && code <= |
6092 | + // 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA |
6093 | + // ABOVE 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU |
6094 | // 0x0B3C == code || // Mn ORIYA SIGN NUKTA |
6095 | // 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA |
6096 | // 0x0B3F == code || // Mn ORIYA VOWEL SIGN I |
6097 | - // (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR |
6098 | - // 0x0B4D == code || // Mn ORIYA SIGN VIRAMA |
6099 | - // 0x0B56 == code || // Mn ORIYA AI LENGTH MARK |
6100 | + // (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN |
6101 | + // U..ORIYA VOWEL SIGN VOCALIC RR 0x0B4D == code || // Mn ORIYA |
6102 | + // SIGN VIRAMA 0x0B56 == code || // Mn ORIYA AI LENGTH MARK |
6103 | // 0x0B57 == code || // Mc ORIYA AU LENGTH MARK |
6104 | - // (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL |
6105 | - // 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA |
6106 | - // 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA |
6107 | + // (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN |
6108 | + // VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL 0x0B82 == code || // Mn |
6109 | + // TAMIL SIGN ANUSVARA 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA |
6110 | // 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II |
6111 | // 0x0BCD == code || // Mn TAMIL SIGN VIRAMA |
6112 | // 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK |
6113 | // 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE |
6114 | - // (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II |
6115 | - // (0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI |
6116 | - // (0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA |
6117 | - // (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK |
6118 | - // (0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL |
6119 | + // (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN |
6120 | + // AA..TELUGU VOWEL SIGN II (0x0C46 <= code && code <= 0x0C48) || // Mn |
6121 | + // [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI (0x0C4A <= code && code |
6122 | + // <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA |
6123 | + // (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH |
6124 | + // MARK..TELUGU AI LENGTH MARK (0x0C62 <= code && code <= 0x0C63) || // |
6125 | + // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL |
6126 | // 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU |
6127 | // 0x0CBC == code || // Mn KANNADA SIGN NUKTA |
6128 | // 0x0CBF == code || // Mn KANNADA VOWEL SIGN I |
6129 | // 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU |
6130 | // 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E |
6131 | - // (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA |
6132 | - // (0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK |
6133 | - // (0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL |
6134 | - // (0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU |
6135 | - // (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA |
6136 | - // 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA |
6137 | - // (0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR |
6138 | + // (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN |
6139 | + // AU..KANNADA SIGN VIRAMA (0x0CD5 <= code && code <= 0x0CD6) || // Mc |
6140 | + // [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK (0x0CE2 <= code && |
6141 | + // code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL |
6142 | + // SIGN VOCALIC LL (0x0D00 <= code && code <= 0x0D01) || // Mn [2] |
6143 | + // MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU |
6144 | + // (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN |
6145 | + // VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA 0x0D3E == code || |
6146 | + // // Mc MALAYALAM VOWEL SIGN AA (0x0D41 <= code && code <= 0x0D44) |
6147 | + // || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR |
6148 | // 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA |
6149 | // 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK |
6150 | - // (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL |
6151 | - // 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA |
6152 | - // 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA |
6153 | - // (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA |
6154 | + // (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN |
6155 | + // VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL 0x0DCA == code || // Mn |
6156 | + // SINHALA SIGN AL-LAKUNA 0x0DCF == code || // Mc SINHALA VOWEL |
6157 | + // SIGN AELA-PILLA (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] |
6158 | + // SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA |
6159 | // 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA |
6160 | // 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA |
6161 | // 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT |
6162 | - // (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU |
6163 | - // (0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN |
6164 | - // 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN |
6165 | - // (0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU |
6166 | - // (0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO |
6167 | - // (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA |
6168 | - // (0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS |
6169 | + // (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA |
6170 | + // I..THAI CHARACTER PHINTHU (0x0E47 <= code && code <= 0x0E4E) || // Mn |
6171 | + // [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN 0x0EB1 == code |
6172 | + // || // Mn LAO VOWEL SIGN MAI KAN (0x0EB4 <= code && code <= |
6173 | + // 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU (0x0EBB <= |
6174 | + // code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL |
6175 | + // SIGN LO (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI |
6176 | + // EK..LAO NIGGAHITA (0x0F18 <= code && code <= 0x0F19) || // Mn [2] |
6177 | + // TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS |
6178 | // 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA |
6179 | // 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS |
6180 | // 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU |
6181 | - // (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO |
6182 | - // (0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA |
6183 | - // (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS |
6184 | - // (0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA |
6185 | - // (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA |
6186 | - // 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN |
6187 | - // (0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU |
6188 | - // (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW |
6189 | - // (0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT |
6190 | - // (0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA |
6191 | - // (0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL |
6192 | - // (0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA |
6193 | - // (0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE |
6194 | - // 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA |
6195 | - // (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y |
6196 | - // 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE |
6197 | - // 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI |
6198 | - // (0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK |
6199 | - // (0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA |
6200 | - // (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD |
6201 | - // (0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U |
6202 | - // (0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U |
6203 | - // (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA |
6204 | - // (0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA |
6205 | - // 0x17C6 == code || // Mn KHMER SIGN NIKAHIT |
6206 | - // (0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT |
6207 | - // 0x17DD == code || // Mn KHMER SIGN ATTHACAN |
6208 | - // (0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE |
6209 | - // (0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA |
6210 | + // (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN |
6211 | + // AA..TIBETAN SIGN RJES SU NGA RO (0x0F80 <= code && code <= 0x0F84) || |
6212 | + // // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA |
6213 | + // (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI |
6214 | + // RTAGS..TIBETAN SIGN YANG RTAGS (0x0F8D <= code && code <= 0x0F97) || |
6215 | + // // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA |
6216 | + // (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED |
6217 | + // LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA 0x0FC6 == code || |
6218 | + // // Mn TIBETAN SYMBOL PADMA GDAN (0x102D <= code && code <= |
6219 | + // 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU |
6220 | + // (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN |
6221 | + // AI..MYANMAR SIGN DOT BELOW (0x1039 <= code && code <= 0x103A) || // Mn |
6222 | + // [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT (0x103D <= code && code <= |
6223 | + // 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT |
6224 | + // SIGN MEDIAL HA (0x1058 <= code && code <= 0x1059) || // Mn [2] |
6225 | + // MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL (0x105E <= |
6226 | + // code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL |
6227 | + // NA..MYANMAR CONSONANT SIGN MON MEDIAL LA (0x1071 <= code && code <= |
6228 | + // 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN |
6229 | + // KAYAH EE 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN |
6230 | + // MEDIAL WA (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR |
6231 | + // VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y 0x108D == |
6232 | + // code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE 0x109D == |
6233 | + // code || // Mn MYANMAR VOWEL SIGN AITON AI (0x135D <= code && |
6234 | + // code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH |
6235 | + // MARK..ETHIOPIC COMBINING GEMINATION MARK (0x1712 <= code && code <= |
6236 | + // 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA |
6237 | + // (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN |
6238 | + // I..HANUNOO SIGN PAMUDPOD (0x1752 <= code && code <= 0x1753) || // Mn |
6239 | + // [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U (0x1772 <= code && code <= |
6240 | + // 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U |
6241 | + // (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT |
6242 | + // AQ..KHMER VOWEL INHERENT AA (0x17B7 <= code && code <= 0x17BD) || // |
6243 | + // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA 0x17C6 == code || // |
6244 | + // Mn KHMER SIGN NIKAHIT (0x17C9 <= code && code <= 0x17D3) || // |
6245 | + // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT 0x17DD == code |
6246 | + // || // Mn KHMER SIGN ATTHACAN (0x180B <= code && code <= 0x180D) |
6247 | + // || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE |
6248 | + // VARIATION SELECTOR THREE (0x1885 <= code && code <= 0x1886) || // Mn |
6249 | + // [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA |
6250 | // 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA |
6251 | - // (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U |
6252 | - // (0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O |
6253 | - // 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA |
6254 | - // (0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I |
6255 | - // (0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U |
6256 | + // (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN |
6257 | + // A..LIMBU VOWEL SIGN U (0x1927 <= code && code <= 0x1928) || // Mn |
6258 | + // [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O 0x1932 == code || // Mn |
6259 | + // LIMBU SMALL LETTER ANUSVARA (0x1939 <= code && code <= 0x193B) || // |
6260 | + // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I (0x1A17 <= code && code |
6261 | + // <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U |
6262 | // 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE |
6263 | // 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA |
6264 | - // (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA |
6265 | - // 0x1A60 == code || // Mn TAI THAM SIGN SAKOT |
6266 | - // 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT |
6267 | - // (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW |
6268 | - // (0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN |
6269 | - // 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT |
6270 | - // (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW |
6271 | - // 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY |
6272 | - // (0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG |
6273 | + // (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI |
6274 | + // KANG LAI..TAI THAM CONSONANT SIGN SA 0x1A60 == code || // Mn TAI |
6275 | + // THAM SIGN SAKOT 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI |
6276 | + // SAT (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL |
6277 | + // SIGN I..TAI THAM VOWEL SIGN OA BELOW (0x1A73 <= code && code <= |
6278 | + // 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE |
6279 | + // KARAN 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC |
6280 | + // DOT (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING |
6281 | + // DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW 0x1ABE == code |
6282 | + // || // Me COMBINING PARENTHESES OVERLAY (0x1B00 <= code && code |
6283 | + // <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG |
6284 | // 0x1B34 == code || // Mn BALINESE SIGN REREKAN |
6285 | - // (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA |
6286 | - // 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA |
6287 | - // 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET |
6288 | - // (0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG |
6289 | - // (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR |
6290 | - // (0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU |
6291 | - // (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG |
6292 | - // (0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA |
6293 | - // 0x1BE6 == code || // Mn BATAK SIGN TOMPI |
6294 | - // (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE |
6295 | - // 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O |
6296 | - // (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H |
6297 | - // (0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T |
6298 | - // (0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA |
6299 | - // (0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA |
6300 | - // (0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA |
6301 | - // (0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL |
6302 | - // 0x1CED == code || // Mn VEDIC SIGN TIRYAK |
6303 | - // 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE |
6304 | - // (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE |
6305 | - // (0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW |
6306 | - // (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW |
6307 | + // (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN |
6308 | + // ULU..BALINESE VOWEL SIGN RA REPA 0x1B3C == code || // Mn |
6309 | + // BALINESE VOWEL SIGN LA LENGA 0x1B42 == code || // Mn BALINESE |
6310 | + // VOWEL SIGN PEPET (0x1B6B <= code && code <= 0x1B73) || // Mn [9] |
6311 | + // BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING |
6312 | + // GONG (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN |
6313 | + // PANYECEK..SUNDANESE SIGN PANGLAYAR (0x1BA2 <= code && code <= 0x1BA5) |
6314 | + // || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN |
6315 | + // PANYUKU (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE |
6316 | + // VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG (0x1BAB <= code && |
6317 | + // code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT |
6318 | + // SIGN PASANGAN WA 0x1BE6 == code || // Mn BATAK SIGN TOMPI |
6319 | + // (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN |
6320 | + // PAKPAK E..BATAK VOWEL SIGN EE 0x1BED == code || // Mn BATAK |
6321 | + // VOWEL SIGN KARO O (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] |
6322 | + // BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H (0x1C2C |
6323 | + // <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA |
6324 | + // CONSONANT SIGN T (0x1C36 <= code && code <= 0x1C37) || // Mn [2] |
6325 | + // LEPCHA SIGN RAN..LEPCHA SIGN NUKTA (0x1CD0 <= code && code <= 0x1CD2) |
6326 | + // || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA (0x1CD4 <= code |
6327 | + // && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE |
6328 | + // SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA (0x1CE2 <= |
6329 | + // code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN |
6330 | + // VISARGA ANUDATTA WITH TAIL 0x1CED == code || // Mn VEDIC SIGN |
6331 | + // TIRYAK 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE |
6332 | + // (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING |
6333 | + // ABOVE..VEDIC TONE DOUBLE RING ABOVE (0x1DC0 <= code && code <= 0x1DF9) |
6334 | + // || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE |
6335 | + // BELOW (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING |
6336 | + // DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW |
6337 | // 0x200C == code || // Cf ZERO WIDTH NON-JOINER |
6338 | - // (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE |
6339 | - // (0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH |
6340 | - // 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE |
6341 | - // (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE |
6342 | - // (0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE |
6343 | - // (0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS |
6344 | + // (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT |
6345 | + // HARPOON ABOVE..COMBINING FOUR DOTS ABOVE (0x20DD <= code && code <= |
6346 | + // 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE |
6347 | + // BACKSLASH 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW |
6348 | + // ABOVE (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING |
6349 | + // ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE (0x20E5 |
6350 | + // <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS |
6351 | + // OVERLAY..COMBINING ASTERISK ABOVE (0x2CEF <= code && code <= 0x2CF1) |
6352 | + // || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS |
6353 | // 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER |
6354 | - // (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS |
6355 | - // (0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK |
6356 | - // (0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK |
6357 | - // (0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK |
6358 | - // 0x_a66F == code || // Mn COMBINING CYRILLIC VZMET |
6359 | - // (0x_a670 <= code && code <= 0x_a672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN |
6360 | - // (0x_a674 <= code && code <= 0x_a67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK |
6361 | - // (0x_a69E <= code && code <= 0x_a69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E |
6362 | - // (0x_a6F0 <= code && code <= 0x_a6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS |
6363 | - // 0x_a802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA |
6364 | - // 0x_a806 == code || // Mn SYLOTI NAGRI SIGN HASANTA |
6365 | - // 0x_a80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA |
6366 | - // (0x_a825 <= code && code <= 0x_a826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E |
6367 | - // (0x_a8C4 <= code && code <= 0x_a8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU |
6368 | - // (0x_a8E0 <= code && code <= 0x_a8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA |
6369 | - // (0x_a926 <= code && code <= 0x_a92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU |
6370 | - // (0x_a947 <= code && code <= 0x_a951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R |
6371 | - // (0x_a980 <= code && code <= 0x_a982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR |
6372 | + // (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC |
6373 | + // LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS (0x302A <= code |
6374 | + // && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC |
6375 | + // ENTERING TONE MARK (0x302E <= code && code <= 0x302F) || // Mc [2] |
6376 | + // HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK (0x3099 <= |
6377 | + // code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED |
6378 | + // SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK 0x_a66F |
6379 | + // == code || // Mn COMBINING CYRILLIC VZMET (0x_a670 <= code && |
6380 | + // code <= 0x_a672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS |
6381 | + // SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN (0x_a674 <= code && |
6382 | + // code <= 0x_a67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN |
6383 | + // IE..COMBINING CYRILLIC PAYEROK (0x_a69E <= code && code <= 0x_a69F) || |
6384 | + // // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED |
6385 | + // E (0x_a6F0 <= code && code <= 0x_a6F1) || // Mn [2] BAMUM COMBINING |
6386 | + // MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS 0x_a802 == code || // Mn |
6387 | + // SYLOTI NAGRI SIGN DVISVARA 0x_a806 == code || // Mn SYLOTI NAGRI |
6388 | + // SIGN HASANTA 0x_a80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA |
6389 | + // (0x_a825 <= code && code <= 0x_a826) || // Mn [2] SYLOTI NAGRI VOWEL |
6390 | + // SIGN U..SYLOTI NAGRI VOWEL SIGN E (0x_a8C4 <= code && code <= 0x_a8C5) |
6391 | + // || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU |
6392 | + // (0x_a8E0 <= code && code <= 0x_a8F1) || // Mn [18] COMBINING |
6393 | + // DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA (0x_a926 <= |
6394 | + // code && code <= 0x_a92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE |
6395 | + // CALYA PLOPHU (0x_a947 <= code && code <= 0x_a951) || // Mn [11] |
6396 | + // REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R (0x_a980 <= code && code |
6397 | + // <= 0x_a982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR |
6398 | // 0x_a9B3 == code || // Mn JAVANESE SIGN CECAK TELU |
6399 | - // (0x_a9B6 <= code && code <= 0x_a9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT |
6400 | - // 0x_a9BC == code || // Mn JAVANESE VOWEL SIGN PEPET |
6401 | - // 0x_a9E5 == code || // Mn MYANMAR SIGN SHAN SAW |
6402 | - // (0x_aA29 <= code && code <= 0x_aA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE |
6403 | - // (0x_aA31 <= code && code <= 0x_aA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE |
6404 | - // (0x_aA35 <= code && code <= 0x_aA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA |
6405 | - // 0x_aA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG |
6406 | + // (0x_a9B6 <= code && code <= 0x_a9B9) || // Mn [4] JAVANESE VOWEL |
6407 | + // SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT 0x_a9BC == code || // Mn |
6408 | + // JAVANESE VOWEL SIGN PEPET 0x_a9E5 == code || // Mn MYANMAR SIGN |
6409 | + // SHAN SAW (0x_aA29 <= code && code <= 0x_aA2E) || // Mn [6] CHAM |
6410 | + // VOWEL SIGN AA..CHAM VOWEL SIGN OE (0x_aA31 <= code && code <= 0x_aA32) |
6411 | + // || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE (0x_aA35 <= code |
6412 | + // && code <= 0x_aA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT |
6413 | + // SIGN WA 0x_aA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG |
6414 | // 0x_aA4C == code || // Mn CHAM CONSONANT SIGN FINAL M |
6415 | // 0x_aA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 |
6416 | // 0x_aAB0 == code || // Mn TAI VIET MAI KANG |
6417 | - // (0x_aAB2 <= code && code <= 0x_aAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U |
6418 | - // (0x_aAB7 <= code && code <= 0x_aAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA |
6419 | - // (0x_aABE <= code && code <= 0x_aABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK |
6420 | + // (0x_aAB2 <= code && code <= 0x_aAB4) || // Mn [3] TAI VIET VOWEL |
6421 | + // I..TAI VIET VOWEL U (0x_aAB7 <= code && code <= 0x_aAB8) || // Mn |
6422 | + // [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA (0x_aABE <= code && code <= |
6423 | + // 0x_aABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK |
6424 | // 0x_aAC1 == code || // Mn TAI VIET TONE MAI THO |
6425 | - // (0x_aAEC <= code && code <= 0x_aAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI |
6426 | - // 0x_aAF6 == code || // Mn MEETEI MAYEK VIRAMA |
6427 | - // 0x_aBE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP |
6428 | - // 0x_aBE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP |
6429 | + // (0x_aAEC <= code && code <= 0x_aAED) || // Mn [2] MEETEI MAYEK VOWEL |
6430 | + // SIGN UU..MEETEI MAYEK VOWEL SIGN AAI 0x_aAF6 == code || // Mn |
6431 | + // MEETEI MAYEK VIRAMA 0x_aBE5 == code || // Mn MEETEI MAYEK VOWEL |
6432 | + // SIGN ANAP 0x_aBE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP |
6433 | // 0x_aBED == code || // Mn MEETEI MAYEK APUN IYEK |
6434 | // 0x_fB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA |
6435 | - // (0x_fE00 <= code && code <= 0x_fE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 |
6436 | - // (0x_fE20 <= code && code <= 0x_fE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF |
6437 | - // (0x_fF9E <= code && code <= 0x_fF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK |
6438 | - // 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE |
6439 | - // 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK |
6440 | - // (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII |
6441 | - // (0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R |
6442 | - // (0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O |
6443 | - // (0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA |
6444 | - // (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW |
6445 | - // 0x10A3F == code || // Mn KHAROSHTHI VIRAMA |
6446 | - // (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW |
6447 | + // (0x_fE00 <= code && code <= 0x_fE0F) || // Mn [16] VARIATION |
6448 | + // SELECTOR-1..VARIATION SELECTOR-16 (0x_fE20 <= code && code <= 0x_fE2F) |
6449 | + // || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT |
6450 | + // HALF (0x_fF9E <= code && code <= 0x_fF9F) || // Lm [2] HALFWIDTH |
6451 | + // KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK |
6452 | + // 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE |
6453 | + // STROKE 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK |
6454 | + // (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD |
6455 | + // PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII (0x10A01 <= code && |
6456 | + // code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL |
6457 | + // SIGN VOCALIC R (0x10A05 <= code && code <= 0x10A06) || // Mn [2] |
6458 | + // KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O (0x10A0C <= code && |
6459 | + // code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN |
6460 | + // VISARGA (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI |
6461 | + // SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW 0x10A3F == code || // Mn |
6462 | + // KHAROSHTHI VIRAMA (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] |
6463 | + // MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW |
6464 | // 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA |
6465 | - // (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA |
6466 | - // (0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA |
6467 | - // (0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI |
6468 | - // (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA |
6469 | - // (0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA |
6470 | - // (0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU |
6471 | - // (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA |
6472 | - // 0x11173 == code || // Mn MAHAJANI SIGN NUKTA |
6473 | - // (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA |
6474 | - // (0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O |
6475 | - // (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK |
6476 | - // (0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI |
6477 | + // (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN |
6478 | + // AA..BRAHMI VIRAMA (0x1107F <= code && code <= 0x11081) || // Mn [3] |
6479 | + // BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA (0x110B3 <= code && code <= |
6480 | + // 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI |
6481 | + // (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN |
6482 | + // VIRAMA..KAITHI SIGN NUKTA (0x11100 <= code && code <= 0x11102) || // |
6483 | + // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA (0x11127 <= code |
6484 | + // && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU |
6485 | + // (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN |
6486 | + // AI..CHAKMA MAAYYAA 0x11173 == code || // Mn MAHAJANI SIGN NUKTA |
6487 | + // (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN |
6488 | + // CANDRABINDU..SHARADA SIGN ANUSVARA (0x111B6 <= code && code <= |
6489 | + // 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O |
6490 | + // (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN |
6491 | + // NUKTA..SHARADA EXTRA SHORT VOWEL MARK (0x1122F <= code && code <= |
6492 | + // 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI |
6493 | // 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA |
6494 | - // (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA |
6495 | - // 0x1123E == code || // Mn KHOJKI SIGN SUKUN |
6496 | - // 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA |
6497 | - // (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA |
6498 | - // (0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU |
6499 | + // (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN |
6500 | + // NUKTA..KHOJKI SIGN SHADDA 0x1123E == code || // Mn KHOJKI SIGN |
6501 | + // SUKUN 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA |
6502 | + // (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL |
6503 | + // SIGN U..KHUDAWADI SIGN VIRAMA (0x11300 <= code && code <= 0x11301) || |
6504 | + // // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU |
6505 | // 0x1133C == code || // Mn GRANTHA SIGN NUKTA |
6506 | // 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA |
6507 | // 0x11340 == code || // Mn GRANTHA VOWEL SIGN II |
6508 | // 0x11357 == code || // Mc GRANTHA AU LENGTH MARK |
6509 | - // (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX |
6510 | - // (0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA |
6511 | - // (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI |
6512 | - // (0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA |
6513 | - // 0x11446 == code || // Mn NEWA SIGN NUKTA |
6514 | - // 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA |
6515 | - // (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL |
6516 | - // 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E |
6517 | - // 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O |
6518 | - // (0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA |
6519 | - // (0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA |
6520 | + // (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA |
6521 | + // DIGIT ZERO..COMBINING GRANTHA DIGIT SIX (0x11370 <= code && code <= |
6522 | + // 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER |
6523 | + // PA (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN |
6524 | + // U..NEWA VOWEL SIGN AI (0x11442 <= code && code <= 0x11444) || // Mn |
6525 | + // [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA 0x11446 == code || // Mn |
6526 | + // NEWA SIGN NUKTA 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA |
6527 | + // (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN |
6528 | + // U..TIRHUTA VOWEL SIGN VOCALIC LL 0x114BA == code || // Mn |
6529 | + // TIRHUTA VOWEL SIGN SHORT E 0x114BD == code || // Mc TIRHUTA |
6530 | + // VOWEL SIGN SHORT O (0x114BF <= code && code <= 0x114C0) || // Mn [2] |
6531 | + // TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA (0x114C2 <= code && |
6532 | + // code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA |
6533 | // 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA |
6534 | - // (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR |
6535 | - // (0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA |
6536 | - // (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA |
6537 | - // (0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU |
6538 | - // (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI |
6539 | - // 0x1163D == code || // Mn MODI SIGN ANUSVARA |
6540 | - // (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA |
6541 | - // 0x116AB == code || // Mn TAKRI SIGN ANUSVARA |
6542 | - // 0x116AD == code || // Mn TAKRI VOWEL SIGN AA |
6543 | - // (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU |
6544 | - // 0x116B7 == code || // Mn TAKRI SIGN NUKTA |
6545 | - // (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA |
6546 | - // (0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU |
6547 | - // (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER |
6548 | - // (0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O |
6549 | - // (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK |
6550 | - // (0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA |
6551 | - // (0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA |
6552 | - // 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER |
6553 | - // (0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE |
6554 | - // (0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK |
6555 | - // (0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA |
6556 | - // (0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER |
6557 | - // (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L |
6558 | - // (0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA |
6559 | + // (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN |
6560 | + // U..SIDDHAM VOWEL SIGN VOCALIC RR (0x115BC <= code && code <= 0x115BD) |
6561 | + // || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA |
6562 | + // (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN |
6563 | + // VIRAMA..SIDDHAM SIGN NUKTA (0x115DC <= code && code <= 0x115DD) || // |
6564 | + // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU |
6565 | + // (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN |
6566 | + // U..MODI VOWEL SIGN AI 0x1163D == code || // Mn MODI SIGN |
6567 | + // ANUSVARA (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN |
6568 | + // VIRAMA..MODI SIGN ARDHACANDRA 0x116AB == code || // Mn TAKRI |
6569 | + // SIGN ANUSVARA 0x116AD == code || // Mn TAKRI VOWEL SIGN AA |
6570 | + // (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN |
6571 | + // U..TAKRI VOWEL SIGN AU 0x116B7 == code || // Mn TAKRI SIGN NUKTA |
6572 | + // (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT |
6573 | + // SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA (0x11722 <= |
6574 | + // code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU |
6575 | + // (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN |
6576 | + // AW..AHOM SIGN KILLER (0x11A01 <= code && code <= 0x11A06) || // Mn |
6577 | + // [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O |
6578 | + // (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE |
6579 | + // VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK (0x11A33 <= |
6580 | + // code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT |
6581 | + // MARK..ZANABAZAR SQUARE SIGN ANUSVARA (0x11A3B <= code && code <= |
6582 | + // 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR |
6583 | + // SQUARE CLUSTER-FINAL LETTER VA 0x11A47 == code || // Mn |
6584 | + // ZANABAZAR SQUARE SUBJOINER (0x11A51 <= code && code <= 0x11A56) || // |
6585 | + // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE (0x11A59 <= code |
6586 | + // && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO |
6587 | + // VOWEL LENGTH MARK (0x11A8A <= code && code <= 0x11A96) || // Mn [13] |
6588 | + // SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA (0x11A98 <= code |
6589 | + // && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER |
6590 | + // (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL |
6591 | + // SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L (0x11C38 <= code && code <= |
6592 | + // 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA |
6593 | // 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA |
6594 | - // (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA |
6595 | - // (0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA |
6596 | - // (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E |
6597 | - // (0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU |
6598 | - // (0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R |
6599 | - // 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E |
6600 | - // (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O |
6601 | - // (0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA |
6602 | - // 0x11D47 == code || // Mn MASARAM GONDI RA-KARA |
6603 | - // (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE |
6604 | - // (0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM |
6605 | - // (0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW |
6606 | - // (0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK |
6607 | + // (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED |
6608 | + // LETTER KA..MARCHEN SUBJOINED LETTER ZA (0x11CAA <= code && code <= |
6609 | + // 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA |
6610 | + // (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN |
6611 | + // U..MARCHEN VOWEL SIGN E (0x11CB5 <= code && code <= 0x11CB6) || // Mn |
6612 | + // [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU (0x11D31 <= code |
6613 | + // && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI |
6614 | + // VOWEL SIGN VOCALIC R 0x11D3A == code || // Mn MASARAM GONDI |
6615 | + // VOWEL SIGN E (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] |
6616 | + // MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O (0x11D3F <= |
6617 | + // code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM |
6618 | + // GONDI VIRAMA 0x11D47 == code || // Mn MASARAM GONDI RA-KARA |
6619 | + // (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH |
6620 | + // COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE (0x16B30 <= |
6621 | + // code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH |
6622 | + // HMONG MARK CIM TAUM (0x16F8F <= code && code <= 0x16F92) || // Mn |
6623 | + // [4] MIAO TONE RIGHT..MIAO TONE BELOW (0x1BC9D <= code && code <= |
6624 | + // 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK |
6625 | // 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM |
6626 | - // (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 |
6627 | - // (0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 |
6628 | - // (0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE |
6629 | - // (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE |
6630 | - // (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO |
6631 | - // (0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME |
6632 | - // (0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN |
6633 | - // (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT |
6634 | - // 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS |
6635 | - // 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK |
6636 | - // (0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 |
6637 | - // (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 |
6638 | - // (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE |
6639 | - // (0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU |
6640 | - // (0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI |
6641 | - // (0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS |
6642 | - // (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA |
6643 | - // (0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS |
6644 | - // (0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA |
6645 | - // (0x_e0020 <= code && code <= 0x_e007F) || // Cf [96] TAG SPACE..CANCEL TAG |
6646 | - // (0x_e0100 <= code && code <= 0x_e01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 |
6647 | - // ){ |
6648 | + // (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL |
6649 | + // COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 (0x1D16E <= |
6650 | + // code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING |
6651 | + // FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 (0x1D17B <= code && code <= |
6652 | + // 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL |
6653 | + // COMBINING LOURE (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] |
6654 | + // MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE |
6655 | + // (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL |
6656 | + // COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO (0x1D242 |
6657 | + // <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL |
6658 | + // TRISEME..COMBINING GREEK MUSICAL PENTASEME (0x1DA00 <= code && code <= |
6659 | + // 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN |
6660 | + // (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH |
6661 | + // CLOSED NEUTRAL..SIGNWRITING EXCITEMENT 0x1DA75 == code || // Mn |
6662 | + // SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS 0x1DA84 == code || // |
6663 | + // Mn SIGNWRITING LOCATION HEAD NECK (0x1DA9B <= code && code <= |
6664 | + // 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL |
6665 | + // MODIFIER-6 (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] |
6666 | + // SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 |
6667 | + // (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING |
6668 | + // GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE (0x1E008 <= |
6669 | + // code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER |
6670 | + // ZEMLJA..COMBINING GLAGOLITIC LETTER HERU (0x1E01B <= code && code <= |
6671 | + // 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING |
6672 | + // GLAGOLITIC LETTER YATI (0x1E023 <= code && code <= 0x1E024) || // Mn |
6673 | + // [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS |
6674 | + // (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING |
6675 | + // GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA (0x1E8D0 <= |
6676 | + // code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER |
6677 | + // TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS (0x1E944 <= code && |
6678 | + // code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA |
6679 | + // (0x_e0020 <= code && code <= 0x_e007F) || // Cf [96] TAG |
6680 | + // SPACE..CANCEL TAG (0x_e0100 <= code && code <= 0x_e01EF) // Mn [240] |
6681 | + // VARIATION SELECTOR-17..VARIATION SELECTOR-256 ){ |
6682 | // return Extend; |
6683 | // } |
6684 | // |
6685 | // |
6686 | // if( |
6687 | - // (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z |
6688 | - // ){ |
6689 | + // (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR |
6690 | + // SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z ){ |
6691 | // return Regional_Indicator; |
6692 | // } |
6693 | // |
6694 | // if( |
6695 | // 0x0903 == code || // Mc DEVANAGARI SIGN VISARGA |
6696 | // 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE |
6697 | - // (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II |
6698 | - // (0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU |
6699 | - // (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW |
6700 | - // (0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA |
6701 | - // (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II |
6702 | - // (0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI |
6703 | - // (0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU |
6704 | + // (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL |
6705 | + // SIGN AA..DEVANAGARI VOWEL SIGN II (0x0949 <= code && code <= 0x094C) |
6706 | + // || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU |
6707 | + // (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL |
6708 | + // SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW (0x0982 <= code && code |
6709 | + // <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA |
6710 | + // (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN |
6711 | + // I..BENGALI VOWEL SIGN II (0x09C7 <= code && code <= 0x09C8) || // Mc |
6712 | + // [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI (0x09CB <= code && |
6713 | + // code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU |
6714 | // 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA |
6715 | - // (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II |
6716 | - // 0x0A83 == code || // Mc GUJARATI SIGN VISARGA |
6717 | - // (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II |
6718 | - // 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O |
6719 | - // (0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU |
6720 | - // (0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA |
6721 | + // (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN |
6722 | + // AA..GURMUKHI VOWEL SIGN II 0x0A83 == code || // Mc GUJARATI SIGN |
6723 | + // VISARGA (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI |
6724 | + // VOWEL SIGN AA..GUJARATI VOWEL SIGN II 0x0AC9 == code || // Mc |
6725 | + // GUJARATI VOWEL SIGN CANDRA O (0x0ACB <= code && code <= 0x0ACC) || // |
6726 | + // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU (0x0B02 <= code |
6727 | + // && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA |
6728 | // 0x0B40 == code || // Mc ORIYA VOWEL SIGN II |
6729 | - // (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI |
6730 | - // (0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU |
6731 | - // 0x0BBF == code || // Mc TAMIL VOWEL SIGN I |
6732 | - // (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU |
6733 | - // (0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI |
6734 | - // (0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU |
6735 | - // (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA |
6736 | - // (0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR |
6737 | - // (0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA |
6738 | - // 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA |
6739 | - // (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U |
6740 | - // (0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR |
6741 | - // (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI |
6742 | - // (0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO |
6743 | - // (0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA |
6744 | - // (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II |
6745 | - // (0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI |
6746 | - // (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU |
6747 | - // (0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA |
6748 | - // (0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA |
6749 | - // (0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA |
6750 | - // (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA |
6751 | + // (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN |
6752 | + // E..ORIYA VOWEL SIGN AI (0x0B4B <= code && code <= 0x0B4C) || // Mc |
6753 | + // [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU 0x0BBF == code || // Mc |
6754 | + // TAMIL VOWEL SIGN I (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] |
6755 | + // TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU (0x0BC6 <= code && code <= |
6756 | + // 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI (0x0BCA |
6757 | + // <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL |
6758 | + // SIGN AU (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN |
6759 | + // CANDRABINDU..TELUGU SIGN VISARGA (0x0C41 <= code && code <= 0x0C44) || |
6760 | + // // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR (0x0C82 |
6761 | + // <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN |
6762 | + // VISARGA 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA |
6763 | + // (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN |
6764 | + // II..KANNADA VOWEL SIGN U (0x0CC3 <= code && code <= 0x0CC4) || // Mc |
6765 | + // [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR |
6766 | + // (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN |
6767 | + // EE..KANNADA VOWEL SIGN AI (0x0CCA <= code && code <= 0x0CCB) || // Mc |
6768 | + // [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO (0x0D02 <= code && |
6769 | + // code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN |
6770 | + // VISARGA (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM |
6771 | + // VOWEL SIGN I..MALAYALAM VOWEL SIGN II (0x0D46 <= code && code <= |
6772 | + // 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI |
6773 | + // (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN |
6774 | + // O..MALAYALAM VOWEL SIGN AU (0x0D82 <= code && code <= 0x0D83) || // Mc |
6775 | + // [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA (0x0DD0 <= code && |
6776 | + // code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA |
6777 | + // VOWEL SIGN DIGA AEDA-PILLA (0x0DD8 <= code && code <= 0x0DDE) || // Mc |
6778 | + // [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA |
6779 | + // GAYANUKITTA (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA |
6780 | + // VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA |
6781 | // 0x0E33 == code || // Lo THAI CHARACTER SARA AM |
6782 | // 0x0EB3 == code || // Lo LAO VOWEL SIGN AM |
6783 | - // (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES |
6784 | - // 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD |
6785 | - // 0x1031 == code || // Mc MYANMAR VOWEL SIGN E |
6786 | - // (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA |
6787 | - // (0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR |
6788 | - // 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E |
6789 | - // 0x17B6 == code || // Mc KHMER VOWEL SIGN AA |
6790 | - // (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU |
6791 | - // (0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU |
6792 | - // (0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU |
6793 | - // (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA |
6794 | - // (0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA |
6795 | - // (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA |
6796 | - // (0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O |
6797 | - // 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA |
6798 | - // 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI |
6799 | - // (0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI |
6800 | + // (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR |
6801 | + // TSHES..TIBETAN SIGN MAR TSHES 0x0F7F == code || // Mc TIBETAN |
6802 | + // SIGN RNAM BCAD 0x1031 == code || // Mc MYANMAR VOWEL SIGN E |
6803 | + // (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT |
6804 | + // SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA (0x1056 <= code && |
6805 | + // code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL |
6806 | + // SIGN VOCALIC RR 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN |
6807 | + // E 0x17B6 == code || // Mc KHMER VOWEL SIGN AA |
6808 | + // (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN |
6809 | + // OE..KHMER VOWEL SIGN AU (0x17C7 <= code && code <= 0x17C8) || // Mc |
6810 | + // [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU (0x1923 <= code && |
6811 | + // code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU |
6812 | + // (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED |
6813 | + // LETTER YA..LIMBU SUBJOINED LETTER WA (0x1930 <= code && code <= |
6814 | + // 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA |
6815 | + // (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER |
6816 | + // TA..LIMBU SMALL LETTER LA (0x1A19 <= code && code <= 0x1A1A) || // Mc |
6817 | + // [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O 0x1A55 == code || // |
6818 | + // Mc TAI THAM CONSONANT SIGN MEDIAL RA 0x1A57 == code || // Mc |
6819 | + // TAI THAM CONSONANT SIGN LA TANG LAI (0x1A6D <= code && code <= 0x1A72) |
6820 | + // || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI |
6821 | // 0x1B04 == code || // Mc BALINESE SIGN BISAH |
6822 | // 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG |
6823 | // 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG |
6824 | - // (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG |
6825 | - // (0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG |
6826 | - // 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD |
6827 | - // 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL |
6828 | - // (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG |
6829 | - // 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH |
6830 | - // 0x1BE7 == code || // Mc BATAK VOWEL SIGN E |
6831 | - // (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O |
6832 | - // 0x1BEE == code || // Mc BATAK VOWEL SIGN U |
6833 | - // (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN |
6834 | - // (0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU |
6835 | - // (0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG |
6836 | - // 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA |
6837 | - // (0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA |
6838 | + // (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN |
6839 | + // LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG (0x1B43 <= |
6840 | + // code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET |
6841 | + // TEDUNG..BALINESE ADEG ADEG 0x1B82 == code || // Mc SUNDANESE |
6842 | + // SIGN PANGWISAD 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN |
6843 | + // PAMINGKAL (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE |
6844 | + // VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG 0x1BAA == code || |
6845 | + // // Mc SUNDANESE SIGN PAMAAEH 0x1BE7 == code || // Mc BATAK |
6846 | + // VOWEL SIGN E (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK |
6847 | + // VOWEL SIGN I..BATAK VOWEL SIGN O 0x1BEE == code || // Mc BATAK |
6848 | + // VOWEL SIGN U (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK |
6849 | + // PANGOLAT..BATAK PANONGONAN (0x1C24 <= code && code <= 0x1C2B) || // Mc |
6850 | + // [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU (0x1C34 <= code |
6851 | + // && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA |
6852 | + // CONSONANT SIGN KANG 0x1CE1 == code || // Mc VEDIC TONE |
6853 | + // ATHARVAVEDIC INDEPENDENT SVARITA (0x1CF2 <= code && code <= 0x1CF3) || |
6854 | + // // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA |
6855 | // 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA |
6856 | - // (0x_a823 <= code && code <= 0x_a824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I |
6857 | - // 0x_a827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO |
6858 | - // (0x_a880 <= code && code <= 0x_a881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA |
6859 | - // (0x_a8B4 <= code && code <= 0x_a8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU |
6860 | - // (0x_a952 <= code && code <= 0x_a953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA |
6861 | - // 0x_a983 == code || // Mc JAVANESE SIGN WIGNYAN |
6862 | - // (0x_a9B4 <= code && code <= 0x_a9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG |
6863 | - // (0x_a9BA <= code && code <= 0x_a9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE |
6864 | - // (0x_a9BD <= code && code <= 0x_a9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON |
6865 | - // (0x_aA2F <= code && code <= 0x_aA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI |
6866 | - // (0x_aA33 <= code && code <= 0x_aA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA |
6867 | - // 0x_aA4D == code || // Mc CHAM CONSONANT SIGN FINAL H |
6868 | - // 0x_aAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II |
6869 | - // (0x_aAEE <= code && code <= 0x_aAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU |
6870 | - // 0x_aAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA |
6871 | - // (0x_aBE3 <= code && code <= 0x_aBE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP |
6872 | - // (0x_aBE6 <= code && code <= 0x_aBE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP |
6873 | - // (0x_aBE9 <= code && code <= 0x_aBEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG |
6874 | - // 0x_aBEC == code || // Mc MEETEI MAYEK LUM IYEK |
6875 | - // 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU |
6876 | - // 0x11002 == code || // Mc BRAHMI SIGN VISARGA |
6877 | - // 0x11082 == code || // Mc KAITHI SIGN VISARGA |
6878 | - // (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II |
6879 | - // (0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU |
6880 | - // 0x1112C == code || // Mc CHAKMA VOWEL SIGN E |
6881 | - // 0x11182 == code || // Mc SHARADA SIGN VISARGA |
6882 | - // (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II |
6883 | - // (0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA |
6884 | - // (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II |
6885 | - // (0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU |
6886 | - // 0x11235 == code || // Mc KHOJKI SIGN VIRAMA |
6887 | - // (0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II |
6888 | - // (0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA |
6889 | + // (0x_a823 <= code && code <= 0x_a824) || // Mc [2] SYLOTI NAGRI VOWEL |
6890 | + // SIGN A..SYLOTI NAGRI VOWEL SIGN I 0x_a827 == code || // Mc |
6891 | + // SYLOTI NAGRI VOWEL SIGN OO (0x_a880 <= code && code <= 0x_a881) || // |
6892 | + // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA (0x_a8B4 <= |
6893 | + // code && code <= 0x_a8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN |
6894 | + // HAARU..SAURASHTRA VOWEL SIGN AU (0x_a952 <= code && code <= 0x_a953) |
6895 | + // || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA 0x_a983 == code |
6896 | + // || // Mc JAVANESE SIGN WIGNYAN (0x_a9B4 <= code && code <= |
6897 | + // 0x_a9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN |
6898 | + // TOLONG (0x_a9BA <= code && code <= 0x_a9BB) || // Mc [2] JAVANESE |
6899 | + // VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE (0x_a9BD <= code && |
6900 | + // code <= 0x_a9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE |
6901 | + // PANGKON (0x_aA2F <= code && code <= 0x_aA30) || // Mc [2] CHAM VOWEL |
6902 | + // SIGN O..CHAM VOWEL SIGN AI (0x_aA33 <= code && code <= 0x_aA34) || // |
6903 | + // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA 0x_aA4D == |
6904 | + // code || // Mc CHAM CONSONANT SIGN FINAL H 0x_aAEB == code || // |
6905 | + // Mc MEETEI MAYEK VOWEL SIGN II (0x_aAEE <= code && code <= |
6906 | + // 0x_aAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN |
6907 | + // AAU 0x_aAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA |
6908 | + // (0x_aBE3 <= code && code <= 0x_aBE4) || // Mc [2] MEETEI MAYEK VOWEL |
6909 | + // SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP (0x_aBE6 <= code && code <= |
6910 | + // 0x_aBE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL |
6911 | + // SIGN SOUNAP (0x_aBE9 <= code && code <= 0x_aBEA) || // Mc [2] MEETEI |
6912 | + // MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG 0x_aBEC == code |
6913 | + // || // Mc MEETEI MAYEK LUM IYEK 0x11000 == code || // Mc |
6914 | + // BRAHMI SIGN CANDRABINDU 0x11002 == code || // Mc BRAHMI SIGN |
6915 | + // VISARGA 0x11082 == code || // Mc KAITHI SIGN VISARGA |
6916 | + // (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN |
6917 | + // AA..KAITHI VOWEL SIGN II (0x110B7 <= code && code <= 0x110B8) || // Mc |
6918 | + // [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU 0x1112C == code || // Mc |
6919 | + // CHAKMA VOWEL SIGN E 0x11182 == code || // Mc SHARADA SIGN |
6920 | + // VISARGA (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA |
6921 | + // VOWEL SIGN AA..SHARADA VOWEL SIGN II (0x111BF <= code && code <= |
6922 | + // 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA |
6923 | + // (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN |
6924 | + // AA..KHOJKI VOWEL SIGN II (0x11232 <= code && code <= 0x11233) || // Mc |
6925 | + // [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU 0x11235 == code || // Mc |
6926 | + // KHOJKI SIGN VIRAMA (0x112E0 <= code && code <= 0x112E2) || // Mc [3] |
6927 | + // KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II (0x11302 <= code && |
6928 | + // code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA |
6929 | // 0x1133F == code || // Mc GRANTHA VOWEL SIGN I |
6930 | - // (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR |
6931 | - // (0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI |
6932 | - // (0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA |
6933 | - // (0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL |
6934 | - // (0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II |
6935 | - // (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU |
6936 | - // 0x11445 == code || // Mc NEWA SIGN VISARGA |
6937 | - // (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II |
6938 | - // 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E |
6939 | - // (0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O |
6940 | - // 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU |
6941 | - // 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA |
6942 | - // (0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II |
6943 | - // (0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU |
6944 | + // (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN |
6945 | + // U..GRANTHA VOWEL SIGN VOCALIC RR (0x11347 <= code && code <= 0x11348) |
6946 | + // || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI (0x1134B |
6947 | + // <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA |
6948 | + // SIGN VIRAMA (0x11362 <= code && code <= 0x11363) || // Mc [2] |
6949 | + // GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL (0x11435 |
6950 | + // <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL |
6951 | + // SIGN II (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL |
6952 | + // SIGN O..NEWA VOWEL SIGN AU 0x11445 == code || // Mc NEWA SIGN |
6953 | + // VISARGA (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA |
6954 | + // VOWEL SIGN I..TIRHUTA VOWEL SIGN II 0x114B9 == code || // Mc |
6955 | + // TIRHUTA VOWEL SIGN E (0x114BB <= code && code <= 0x114BC) || // Mc |
6956 | + // [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O 0x114BE == code || // |
6957 | + // Mc TIRHUTA VOWEL SIGN AU 0x114C1 == code || // Mc TIRHUTA |
6958 | + // SIGN VISARGA (0x115B0 <= code && code <= 0x115B1) || // Mc [2] |
6959 | + // SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II (0x115B8 <= code && code |
6960 | + // <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU |
6961 | // 0x115BE == code || // Mc SIDDHAM SIGN VISARGA |
6962 | - // (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II |
6963 | - // (0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU |
6964 | - // 0x1163E == code || // Mc MODI SIGN VISARGA |
6965 | - // 0x116AC == code || // Mc TAKRI SIGN VISARGA |
6966 | - // (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II |
6967 | - // 0x116B6 == code || // Mc TAKRI SIGN VIRAMA |
6968 | - // (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA |
6969 | - // 0x11726 == code || // Mc AHOM VOWEL SIGN E |
6970 | - // (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU |
6971 | - // 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA |
6972 | - // (0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU |
6973 | + // (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN |
6974 | + // AA..MODI VOWEL SIGN II (0x1163B <= code && code <= 0x1163C) || // Mc |
6975 | + // [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU 0x1163E == code || // Mc |
6976 | + // MODI SIGN VISARGA 0x116AC == code || // Mc TAKRI SIGN VISARGA |
6977 | + // (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN |
6978 | + // I..TAKRI VOWEL SIGN II 0x116B6 == code || // Mc TAKRI SIGN |
6979 | + // VIRAMA (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL |
6980 | + // SIGN A..AHOM VOWEL SIGN AA 0x11726 == code || // Mc AHOM VOWEL |
6981 | + // SIGN E (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR |
6982 | + // SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU 0x11A39 == code |
6983 | + // || // Mc ZANABAZAR SQUARE SIGN VISARGA (0x11A57 <= code && code |
6984 | + // <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU |
6985 | // 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA |
6986 | // 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA |
6987 | // 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA |
6988 | // 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA |
6989 | // 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I |
6990 | // 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O |
6991 | - // (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG |
6992 | - // 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM |
6993 | - // 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT |
6994 | - // ){ |
6995 | + // (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN |
6996 | + // ASPIRATION..MIAO VOWEL SIGN NG 0x1D166 == code || // Mc MUSICAL |
6997 | + // SYMBOL COMBINING SPRECHGESANG STEM 0x1D16D == code // Mc MUSICAL |
6998 | + // SYMBOL COMBINING AUGMENTATION DOT ){ |
6999 | // return SpacingMark; |
7000 | // } |
7001 | // |
7002 | // |
7003 | // if( |
7004 | - // (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER |
7005 | - // (0x_a960 <= code && code <= 0x_a97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH |
7006 | - // ){ |
7007 | + // (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG |
7008 | + // KIYEOK..HANGUL CHOSEONG FILLER (0x_a960 <= code && code <= 0x_a97C) // |
7009 | + // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH ){ |
7010 | // return L; |
7011 | // } |
7012 | // |
7013 | // if( |
7014 | - // (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE |
7015 | - // (0x_d7B0 <= code && code <= 0x_d7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E |
7016 | - // ){ |
7017 | + // (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG |
7018 | + // FILLER..HANGUL JUNGSEONG O-YAE (0x_d7B0 <= code && code <= 0x_d7C6) // |
7019 | + // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E ){ |
7020 | // return V; |
7021 | // } |
7022 | // |
7023 | // |
7024 | // if( |
7025 | - // (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN |
7026 | - // (0x_d7CB <= code && code <= 0x_d7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH |
7027 | - // ){ |
7028 | + // (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG |
7029 | + // KIYEOK..HANGUL JONGSEONG SSANGNIEUN (0x_d7CB <= code && code <= |
7030 | + // 0x_d7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG |
7031 | + // PHIEUPH-THIEUTH ){ |
7032 | // return T; |
7033 | // } |
7034 | // |
7035 | @@ -1397,448 +1533,601 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
7036 | // } |
7037 | // |
7038 | // if( |
7039 | - // (0x_aC01 <= code && code <= 0x_aC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH |
7040 | - // (0x_aC1D <= code && code <= 0x_aC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH |
7041 | - // (0x_aC39 <= code && code <= 0x_aC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH |
7042 | - // (0x_aC55 <= code && code <= 0x_aC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH |
7043 | - // (0x_aC71 <= code && code <= 0x_aC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH |
7044 | - // (0x_aC8D <= code && code <= 0x_aCA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH |
7045 | - // (0x_aCA9 <= code && code <= 0x_aCC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH |
7046 | - // (0x_aCC5 <= code && code <= 0x_aCDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH |
7047 | - // (0x_aCE1 <= code && code <= 0x_aCFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH |
7048 | - // (0x_aCFD <= code && code <= 0x_aD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH |
7049 | - // (0x_aD19 <= code && code <= 0x_aD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH |
7050 | - // (0x_aD35 <= code && code <= 0x_aD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH |
7051 | - // (0x_aD51 <= code && code <= 0x_aD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH |
7052 | - // (0x_aD6D <= code && code <= 0x_aD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH |
7053 | - // (0x_aD89 <= code && code <= 0x_aDA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH |
7054 | - // (0x_aDA5 <= code && code <= 0x_aDBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH |
7055 | - // (0x_aDC1 <= code && code <= 0x_aDDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH |
7056 | - // (0x_aDDD <= code && code <= 0x_aDF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH |
7057 | - // (0x_aDF9 <= code && code <= 0x_aE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH |
7058 | - // (0x_aE15 <= code && code <= 0x_aE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH |
7059 | - // (0x_aE31 <= code && code <= 0x_aE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH |
7060 | - // (0x_aE4D <= code && code <= 0x_aE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH |
7061 | - // (0x_aE69 <= code && code <= 0x_aE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH |
7062 | - // (0x_aE85 <= code && code <= 0x_aE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH |
7063 | - // (0x_aEA1 <= code && code <= 0x_aEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH |
7064 | - // (0x_aEBD <= code && code <= 0x_aED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH |
7065 | - // (0x_aED9 <= code && code <= 0x_aEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH |
7066 | - // (0x_aEF5 <= code && code <= 0x_aF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH |
7067 | - // (0x_aF11 <= code && code <= 0x_aF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH |
7068 | - // (0x_aF2D <= code && code <= 0x_aF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH |
7069 | - // (0x_aF49 <= code && code <= 0x_aF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH |
7070 | - // (0x_aF65 <= code && code <= 0x_aF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH |
7071 | - // (0x_aF81 <= code && code <= 0x_aF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH |
7072 | - // (0x_aF9D <= code && code <= 0x_aFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH |
7073 | - // (0x_aFB9 <= code && code <= 0x_aFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH |
7074 | - // (0x_aFD5 <= code && code <= 0x_aFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH |
7075 | - // (0x_aFF1 <= code && code <= 0x_b00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH |
7076 | - // (0x_b00D <= code && code <= 0x_b027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH |
7077 | - // (0x_b029 <= code && code <= 0x_b043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH |
7078 | - // (0x_b045 <= code && code <= 0x_b05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH |
7079 | - // (0x_b061 <= code && code <= 0x_b07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH |
7080 | - // (0x_b07D <= code && code <= 0x_b097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH |
7081 | - // (0x_b099 <= code && code <= 0x_b0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH |
7082 | - // (0x_b0B5 <= code && code <= 0x_b0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH |
7083 | - // (0x_b0D1 <= code && code <= 0x_b0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH |
7084 | - // (0x_b0ED <= code && code <= 0x_b107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH |
7085 | - // (0x_b109 <= code && code <= 0x_b123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH |
7086 | - // (0x_b125 <= code && code <= 0x_b13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH |
7087 | - // (0x_b141 <= code && code <= 0x_b15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH |
7088 | - // (0x_b15D <= code && code <= 0x_b177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH |
7089 | - // (0x_b179 <= code && code <= 0x_b193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH |
7090 | - // (0x_b195 <= code && code <= 0x_b1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH |
7091 | - // (0x_b1B1 <= code && code <= 0x_b1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH |
7092 | - // (0x_b1CD <= code && code <= 0x_b1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH |
7093 | - // (0x_b1E9 <= code && code <= 0x_b203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH |
7094 | - // (0x_b205 <= code && code <= 0x_b21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH |
7095 | - // (0x_b221 <= code && code <= 0x_b23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH |
7096 | - // (0x_b23D <= code && code <= 0x_b257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH |
7097 | - // (0x_b259 <= code && code <= 0x_b273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH |
7098 | - // (0x_b275 <= code && code <= 0x_b28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH |
7099 | - // (0x_b291 <= code && code <= 0x_b2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH |
7100 | - // (0x_b2AD <= code && code <= 0x_b2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH |
7101 | - // (0x_b2C9 <= code && code <= 0x_b2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH |
7102 | - // (0x_b2E5 <= code && code <= 0x_b2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH |
7103 | - // (0x_b301 <= code && code <= 0x_b31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH |
7104 | - // (0x_b31D <= code && code <= 0x_b337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH |
7105 | - // (0x_b339 <= code && code <= 0x_b353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH |
7106 | - // (0x_b355 <= code && code <= 0x_b36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH |
7107 | - // (0x_b371 <= code && code <= 0x_b38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH |
7108 | - // (0x_b38D <= code && code <= 0x_b3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH |
7109 | - // (0x_b3A9 <= code && code <= 0x_b3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH |
7110 | - // (0x_b3C5 <= code && code <= 0x_b3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH |
7111 | - // (0x_b3E1 <= code && code <= 0x_b3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH |
7112 | - // (0x_b3FD <= code && code <= 0x_b417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH |
7113 | - // (0x_b419 <= code && code <= 0x_b433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH |
7114 | - // (0x_b435 <= code && code <= 0x_b44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH |
7115 | - // (0x_b451 <= code && code <= 0x_b46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH |
7116 | - // (0x_b46D <= code && code <= 0x_b487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH |
7117 | - // (0x_b489 <= code && code <= 0x_b4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH |
7118 | - // (0x_b4A5 <= code && code <= 0x_b4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH |
7119 | - // (0x_b4C1 <= code && code <= 0x_b4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH |
7120 | - // (0x_b4DD <= code && code <= 0x_b4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH |
7121 | - // (0x_b4F9 <= code && code <= 0x_b513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH |
7122 | - // (0x_b515 <= code && code <= 0x_b52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH |
7123 | - // (0x_b531 <= code && code <= 0x_b54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH |
7124 | - // (0x_b54D <= code && code <= 0x_b567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH |
7125 | - // (0x_b569 <= code && code <= 0x_b583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH |
7126 | - // (0x_b585 <= code && code <= 0x_b59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH |
7127 | - // (0x_b5A1 <= code && code <= 0x_b5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH |
7128 | - // (0x_b5BD <= code && code <= 0x_b5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH |
7129 | - // (0x_b5D9 <= code && code <= 0x_b5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH |
7130 | - // (0x_b5F5 <= code && code <= 0x_b60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH |
7131 | - // (0x_b611 <= code && code <= 0x_b62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH |
7132 | - // (0x_b62D <= code && code <= 0x_b647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH |
7133 | - // (0x_b649 <= code && code <= 0x_b663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH |
7134 | - // (0x_b665 <= code && code <= 0x_b67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH |
7135 | - // (0x_b681 <= code && code <= 0x_b69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH |
7136 | - // (0x_b69D <= code && code <= 0x_b6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH |
7137 | - // (0x_b6B9 <= code && code <= 0x_b6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH |
7138 | - // (0x_b6D5 <= code && code <= 0x_b6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH |
7139 | - // (0x_b6F1 <= code && code <= 0x_b70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH |
7140 | - // (0x_b70D <= code && code <= 0x_b727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH |
7141 | - // (0x_b729 <= code && code <= 0x_b743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH |
7142 | - // (0x_b745 <= code && code <= 0x_b75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH |
7143 | - // (0x_b761 <= code && code <= 0x_b77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH |
7144 | - // (0x_b77D <= code && code <= 0x_b797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH |
7145 | - // (0x_b799 <= code && code <= 0x_b7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH |
7146 | - // (0x_b7B5 <= code && code <= 0x_b7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH |
7147 | - // (0x_b7D1 <= code && code <= 0x_b7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH |
7148 | - // (0x_b7ED <= code && code <= 0x_b807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH |
7149 | - // (0x_b809 <= code && code <= 0x_b823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH |
7150 | - // (0x_b825 <= code && code <= 0x_b83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH |
7151 | - // (0x_b841 <= code && code <= 0x_b85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH |
7152 | - // (0x_b85D <= code && code <= 0x_b877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH |
7153 | - // (0x_b879 <= code && code <= 0x_b893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH |
7154 | - // (0x_b895 <= code && code <= 0x_b8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH |
7155 | - // (0x_b8B1 <= code && code <= 0x_b8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH |
7156 | - // (0x_b8CD <= code && code <= 0x_b8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH |
7157 | - // (0x_b8E9 <= code && code <= 0x_b903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH |
7158 | - // (0x_b905 <= code && code <= 0x_b91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH |
7159 | - // (0x_b921 <= code && code <= 0x_b93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH |
7160 | - // (0x_b93D <= code && code <= 0x_b957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH |
7161 | - // (0x_b959 <= code && code <= 0x_b973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH |
7162 | - // (0x_b975 <= code && code <= 0x_b98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH |
7163 | - // (0x_b991 <= code && code <= 0x_b9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH |
7164 | - // (0x_b9AD <= code && code <= 0x_b9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH |
7165 | - // (0x_b9C9 <= code && code <= 0x_b9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH |
7166 | - // (0x_b9E5 <= code && code <= 0x_b9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH |
7167 | - // (0x_bA01 <= code && code <= 0x_bA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH |
7168 | - // (0x_bA1D <= code && code <= 0x_bA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH |
7169 | - // (0x_bA39 <= code && code <= 0x_bA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH |
7170 | - // (0x_bA55 <= code && code <= 0x_bA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH |
7171 | - // (0x_bA71 <= code && code <= 0x_bA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH |
7172 | - // (0x_bA8D <= code && code <= 0x_bAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH |
7173 | - // (0x_bAA9 <= code && code <= 0x_bAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH |
7174 | - // (0x_bAC5 <= code && code <= 0x_bADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH |
7175 | - // (0x_bAE1 <= code && code <= 0x_bAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH |
7176 | - // (0x_bAFD <= code && code <= 0x_bB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH |
7177 | - // (0x_bB19 <= code && code <= 0x_bB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH |
7178 | - // (0x_bB35 <= code && code <= 0x_bB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH |
7179 | - // (0x_bB51 <= code && code <= 0x_bB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH |
7180 | - // (0x_bB6D <= code && code <= 0x_bB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH |
7181 | - // (0x_bB89 <= code && code <= 0x_bBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH |
7182 | - // (0x_bBA5 <= code && code <= 0x_bBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH |
7183 | - // (0x_bBC1 <= code && code <= 0x_bBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH |
7184 | - // (0x_bBDD <= code && code <= 0x_bBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH |
7185 | - // (0x_bBF9 <= code && code <= 0x_bC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH |
7186 | - // (0x_bC15 <= code && code <= 0x_bC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH |
7187 | - // (0x_bC31 <= code && code <= 0x_bC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH |
7188 | - // (0x_bC4D <= code && code <= 0x_bC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH |
7189 | - // (0x_bC69 <= code && code <= 0x_bC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH |
7190 | - // (0x_bC85 <= code && code <= 0x_bC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH |
7191 | - // (0x_bCA1 <= code && code <= 0x_bCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH |
7192 | - // (0x_bCBD <= code && code <= 0x_bCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH |
7193 | - // (0x_bCD9 <= code && code <= 0x_bCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH |
7194 | - // (0x_bCF5 <= code && code <= 0x_bD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH |
7195 | - // (0x_bD11 <= code && code <= 0x_bD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH |
7196 | - // (0x_bD2D <= code && code <= 0x_bD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH |
7197 | - // (0x_bD49 <= code && code <= 0x_bD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH |
7198 | - // (0x_bD65 <= code && code <= 0x_bD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH |
7199 | - // (0x_bD81 <= code && code <= 0x_bD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH |
7200 | - // (0x_bD9D <= code && code <= 0x_bDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH |
7201 | - // (0x_bDB9 <= code && code <= 0x_bDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH |
7202 | - // (0x_bDD5 <= code && code <= 0x_bDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH |
7203 | - // (0x_bDF1 <= code && code <= 0x_bE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH |
7204 | - // (0x_bE0D <= code && code <= 0x_bE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH |
7205 | - // (0x_bE29 <= code && code <= 0x_bE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH |
7206 | - // (0x_bE45 <= code && code <= 0x_bE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH |
7207 | - // (0x_bE61 <= code && code <= 0x_bE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH |
7208 | - // (0x_bE7D <= code && code <= 0x_bE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH |
7209 | - // (0x_bE99 <= code && code <= 0x_bEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH |
7210 | - // (0x_bEB5 <= code && code <= 0x_bECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH |
7211 | - // (0x_bED1 <= code && code <= 0x_bEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH |
7212 | - // (0x_bEED <= code && code <= 0x_bF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH |
7213 | - // (0x_bF09 <= code && code <= 0x_bF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH |
7214 | - // (0x_bF25 <= code && code <= 0x_bF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH |
7215 | - // (0x_bF41 <= code && code <= 0x_bF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH |
7216 | - // (0x_bF5D <= code && code <= 0x_bF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH |
7217 | - // (0x_bF79 <= code && code <= 0x_bF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH |
7218 | - // (0x_bF95 <= code && code <= 0x_bFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH |
7219 | - // (0x_bFB1 <= code && code <= 0x_bFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH |
7220 | - // (0x_bFCD <= code && code <= 0x_bFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH |
7221 | - // (0x_bFE9 <= code && code <= 0x_c003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH |
7222 | - // (0x_c005 <= code && code <= 0x_c01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH |
7223 | - // (0x_c021 <= code && code <= 0x_c03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH |
7224 | - // (0x_c03D <= code && code <= 0x_c057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH |
7225 | - // (0x_c059 <= code && code <= 0x_c073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH |
7226 | - // (0x_c075 <= code && code <= 0x_c08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH |
7227 | - // (0x_c091 <= code && code <= 0x_c0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH |
7228 | - // (0x_c0AD <= code && code <= 0x_c0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH |
7229 | - // (0x_c0C9 <= code && code <= 0x_c0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH |
7230 | - // (0x_c0E5 <= code && code <= 0x_c0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH |
7231 | - // (0x_c101 <= code && code <= 0x_c11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH |
7232 | - // (0x_c11D <= code && code <= 0x_c137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH |
7233 | - // (0x_c139 <= code && code <= 0x_c153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH |
7234 | - // (0x_c155 <= code && code <= 0x_c16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH |
7235 | - // (0x_c171 <= code && code <= 0x_c18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH |
7236 | - // (0x_c18D <= code && code <= 0x_c1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH |
7237 | - // (0x_c1A9 <= code && code <= 0x_c1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH |
7238 | - // (0x_c1C5 <= code && code <= 0x_c1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH |
7239 | - // (0x_c1E1 <= code && code <= 0x_c1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH |
7240 | - // (0x_c1FD <= code && code <= 0x_c217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH |
7241 | - // (0x_c219 <= code && code <= 0x_c233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH |
7242 | - // (0x_c235 <= code && code <= 0x_c24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH |
7243 | - // (0x_c251 <= code && code <= 0x_c26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH |
7244 | - // (0x_c26D <= code && code <= 0x_c287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH |
7245 | - // (0x_c289 <= code && code <= 0x_c2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH |
7246 | - // (0x_c2A5 <= code && code <= 0x_c2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH |
7247 | - // (0x_c2C1 <= code && code <= 0x_c2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH |
7248 | - // (0x_c2DD <= code && code <= 0x_c2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH |
7249 | - // (0x_c2F9 <= code && code <= 0x_c313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH |
7250 | - // (0x_c315 <= code && code <= 0x_c32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH |
7251 | - // (0x_c331 <= code && code <= 0x_c34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH |
7252 | - // (0x_c34D <= code && code <= 0x_c367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH |
7253 | - // (0x_c369 <= code && code <= 0x_c383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH |
7254 | - // (0x_c385 <= code && code <= 0x_c39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH |
7255 | - // (0x_c3A1 <= code && code <= 0x_c3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH |
7256 | - // (0x_c3BD <= code && code <= 0x_c3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH |
7257 | - // (0x_c3D9 <= code && code <= 0x_c3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH |
7258 | - // (0x_c3F5 <= code && code <= 0x_c40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH |
7259 | - // (0x_c411 <= code && code <= 0x_c42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH |
7260 | - // (0x_c42D <= code && code <= 0x_c447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH |
7261 | - // (0x_c449 <= code && code <= 0x_c463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH |
7262 | - // (0x_c465 <= code && code <= 0x_c47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH |
7263 | - // (0x_c481 <= code && code <= 0x_c49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH |
7264 | - // (0x_c49D <= code && code <= 0x_c4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH |
7265 | - // (0x_c4B9 <= code && code <= 0x_c4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH |
7266 | - // (0x_c4D5 <= code && code <= 0x_c4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH |
7267 | - // (0x_c4F1 <= code && code <= 0x_c50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH |
7268 | - // (0x_c50D <= code && code <= 0x_c527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH |
7269 | - // (0x_c529 <= code && code <= 0x_c543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH |
7270 | - // (0x_c545 <= code && code <= 0x_c55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH |
7271 | - // (0x_c561 <= code && code <= 0x_c57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH |
7272 | - // (0x_c57D <= code && code <= 0x_c597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH |
7273 | - // (0x_c599 <= code && code <= 0x_c5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH |
7274 | - // (0x_c5B5 <= code && code <= 0x_c5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH |
7275 | - // (0x_c5D1 <= code && code <= 0x_c5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH |
7276 | - // (0x_c5ED <= code && code <= 0x_c607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH |
7277 | - // (0x_c609 <= code && code <= 0x_c623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH |
7278 | - // (0x_c625 <= code && code <= 0x_c63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH |
7279 | - // (0x_c641 <= code && code <= 0x_c65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH |
7280 | - // (0x_c65D <= code && code <= 0x_c677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH |
7281 | - // (0x_c679 <= code && code <= 0x_c693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH |
7282 | - // (0x_c695 <= code && code <= 0x_c6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH |
7283 | - // (0x_c6B1 <= code && code <= 0x_c6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH |
7284 | - // (0x_c6CD <= code && code <= 0x_c6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH |
7285 | - // (0x_c6E9 <= code && code <= 0x_c703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH |
7286 | - // (0x_c705 <= code && code <= 0x_c71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH |
7287 | - // (0x_c721 <= code && code <= 0x_c73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH |
7288 | - // (0x_c73D <= code && code <= 0x_c757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH |
7289 | - // (0x_c759 <= code && code <= 0x_c773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH |
7290 | - // (0x_c775 <= code && code <= 0x_c78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH |
7291 | - // (0x_c791 <= code && code <= 0x_c7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH |
7292 | - // (0x_c7AD <= code && code <= 0x_c7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH |
7293 | - // (0x_c7C9 <= code && code <= 0x_c7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH |
7294 | - // (0x_c7E5 <= code && code <= 0x_c7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH |
7295 | - // (0x_c801 <= code && code <= 0x_c81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH |
7296 | - // (0x_c81D <= code && code <= 0x_c837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH |
7297 | - // (0x_c839 <= code && code <= 0x_c853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH |
7298 | - // (0x_c855 <= code && code <= 0x_c86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH |
7299 | - // (0x_c871 <= code && code <= 0x_c88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH |
7300 | - // (0x_c88D <= code && code <= 0x_c8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH |
7301 | - // (0x_c8A9 <= code && code <= 0x_c8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH |
7302 | - // (0x_c8C5 <= code && code <= 0x_c8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH |
7303 | - // (0x_c8E1 <= code && code <= 0x_c8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH |
7304 | - // (0x_c8FD <= code && code <= 0x_c917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH |
7305 | - // (0x_c919 <= code && code <= 0x_c933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH |
7306 | - // (0x_c935 <= code && code <= 0x_c94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH |
7307 | - // (0x_c951 <= code && code <= 0x_c96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH |
7308 | - // (0x_c96D <= code && code <= 0x_c987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH |
7309 | - // (0x_c989 <= code && code <= 0x_c9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH |
7310 | - // (0x_c9A5 <= code && code <= 0x_c9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH |
7311 | - // (0x_c9C1 <= code && code <= 0x_c9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH |
7312 | - // (0x_c9DD <= code && code <= 0x_c9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH |
7313 | - // (0x_c9F9 <= code && code <= 0x_cA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH |
7314 | - // (0x_cA15 <= code && code <= 0x_cA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH |
7315 | - // (0x_cA31 <= code && code <= 0x_cA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH |
7316 | - // (0x_cA4D <= code && code <= 0x_cA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH |
7317 | - // (0x_cA69 <= code && code <= 0x_cA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH |
7318 | - // (0x_cA85 <= code && code <= 0x_cA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH |
7319 | - // (0x_cAA1 <= code && code <= 0x_cABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH |
7320 | - // (0x_cABD <= code && code <= 0x_cAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH |
7321 | - // (0x_cAD9 <= code && code <= 0x_cAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH |
7322 | - // (0x_cAF5 <= code && code <= 0x_cB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH |
7323 | - // (0x_cB11 <= code && code <= 0x_cB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH |
7324 | - // (0x_cB2D <= code && code <= 0x_cB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH |
7325 | - // (0x_cB49 <= code && code <= 0x_cB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH |
7326 | - // (0x_cB65 <= code && code <= 0x_cB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH |
7327 | - // (0x_cB81 <= code && code <= 0x_cB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH |
7328 | - // (0x_cB9D <= code && code <= 0x_cBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH |
7329 | - // (0x_cBB9 <= code && code <= 0x_cBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH |
7330 | - // (0x_cBD5 <= code && code <= 0x_cBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH |
7331 | - // (0x_cBF1 <= code && code <= 0x_cC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH |
7332 | - // (0x_cC0D <= code && code <= 0x_cC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH |
7333 | - // (0x_cC29 <= code && code <= 0x_cC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH |
7334 | - // (0x_cC45 <= code && code <= 0x_cC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH |
7335 | - // (0x_cC61 <= code && code <= 0x_cC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH |
7336 | - // (0x_cC7D <= code && code <= 0x_cC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH |
7337 | - // (0x_cC99 <= code && code <= 0x_cCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH |
7338 | - // (0x_cCB5 <= code && code <= 0x_cCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH |
7339 | - // (0x_cCD1 <= code && code <= 0x_cCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH |
7340 | - // (0x_cCED <= code && code <= 0x_cD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH |
7341 | - // (0x_cD09 <= code && code <= 0x_cD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH |
7342 | - // (0x_cD25 <= code && code <= 0x_cD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH |
7343 | - // (0x_cD41 <= code && code <= 0x_cD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH |
7344 | - // (0x_cD5D <= code && code <= 0x_cD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH |
7345 | - // (0x_cD79 <= code && code <= 0x_cD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH |
7346 | - // (0x_cD95 <= code && code <= 0x_cDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH |
7347 | - // (0x_cDB1 <= code && code <= 0x_cDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH |
7348 | - // (0x_cDCD <= code && code <= 0x_cDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH |
7349 | - // (0x_cDE9 <= code && code <= 0x_cE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH |
7350 | - // (0x_cE05 <= code && code <= 0x_cE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH |
7351 | - // (0x_cE21 <= code && code <= 0x_cE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH |
7352 | - // (0x_cE3D <= code && code <= 0x_cE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH |
7353 | - // (0x_cE59 <= code && code <= 0x_cE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH |
7354 | - // (0x_cE75 <= code && code <= 0x_cE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH |
7355 | - // (0x_cE91 <= code && code <= 0x_cEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH |
7356 | - // (0x_cEAD <= code && code <= 0x_cEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH |
7357 | - // (0x_cEC9 <= code && code <= 0x_cEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH |
7358 | - // (0x_cEE5 <= code && code <= 0x_cEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH |
7359 | - // (0x_cF01 <= code && code <= 0x_cF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH |
7360 | - // (0x_cF1D <= code && code <= 0x_cF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH |
7361 | - // (0x_cF39 <= code && code <= 0x_cF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH |
7362 | - // (0x_cF55 <= code && code <= 0x_cF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH |
7363 | - // (0x_cF71 <= code && code <= 0x_cF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH |
7364 | - // (0x_cF8D <= code && code <= 0x_cFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH |
7365 | - // (0x_cFA9 <= code && code <= 0x_cFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH |
7366 | - // (0x_cFC5 <= code && code <= 0x_cFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH |
7367 | - // (0x_cFE1 <= code && code <= 0x_cFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH |
7368 | - // (0x_cFFD <= code && code <= 0x_d017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH |
7369 | - // (0x_d019 <= code && code <= 0x_d033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH |
7370 | - // (0x_d035 <= code && code <= 0x_d04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH |
7371 | - // (0x_d051 <= code && code <= 0x_d06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH |
7372 | - // (0x_d06D <= code && code <= 0x_d087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH |
7373 | - // (0x_d089 <= code && code <= 0x_d0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH |
7374 | - // (0x_d0A5 <= code && code <= 0x_d0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH |
7375 | - // (0x_d0C1 <= code && code <= 0x_d0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH |
7376 | - // (0x_d0DD <= code && code <= 0x_d0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH |
7377 | - // (0x_d0F9 <= code && code <= 0x_d113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH |
7378 | - // (0x_d115 <= code && code <= 0x_d12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH |
7379 | - // (0x_d131 <= code && code <= 0x_d14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH |
7380 | - // (0x_d14D <= code && code <= 0x_d167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH |
7381 | - // (0x_d169 <= code && code <= 0x_d183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH |
7382 | - // (0x_d185 <= code && code <= 0x_d19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH |
7383 | - // (0x_d1A1 <= code && code <= 0x_d1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH |
7384 | - // (0x_d1BD <= code && code <= 0x_d1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH |
7385 | - // (0x_d1D9 <= code && code <= 0x_d1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH |
7386 | - // (0x_d1F5 <= code && code <= 0x_d20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH |
7387 | - // (0x_d211 <= code && code <= 0x_d22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH |
7388 | - // (0x_d22D <= code && code <= 0x_d247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH |
7389 | - // (0x_d249 <= code && code <= 0x_d263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH |
7390 | - // (0x_d265 <= code && code <= 0x_d27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH |
7391 | - // (0x_d281 <= code && code <= 0x_d29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH |
7392 | - // (0x_d29D <= code && code <= 0x_d2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH |
7393 | - // (0x_d2B9 <= code && code <= 0x_d2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH |
7394 | - // (0x_d2D5 <= code && code <= 0x_d2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH |
7395 | - // (0x_d2F1 <= code && code <= 0x_d30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH |
7396 | - // (0x_d30D <= code && code <= 0x_d327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH |
7397 | - // (0x_d329 <= code && code <= 0x_d343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH |
7398 | - // (0x_d345 <= code && code <= 0x_d35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH |
7399 | - // (0x_d361 <= code && code <= 0x_d37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH |
7400 | - // (0x_d37D <= code && code <= 0x_d397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH |
7401 | - // (0x_d399 <= code && code <= 0x_d3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH |
7402 | - // (0x_d3B5 <= code && code <= 0x_d3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH |
7403 | - // (0x_d3D1 <= code && code <= 0x_d3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH |
7404 | - // (0x_d3ED <= code && code <= 0x_d407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH |
7405 | - // (0x_d409 <= code && code <= 0x_d423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH |
7406 | - // (0x_d425 <= code && code <= 0x_d43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH |
7407 | - // (0x_d441 <= code && code <= 0x_d45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH |
7408 | - // (0x_d45D <= code && code <= 0x_d477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH |
7409 | - // (0x_d479 <= code && code <= 0x_d493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH |
7410 | - // (0x_d495 <= code && code <= 0x_d4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH |
7411 | - // (0x_d4B1 <= code && code <= 0x_d4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH |
7412 | - // (0x_d4CD <= code && code <= 0x_d4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH |
7413 | - // (0x_d4E9 <= code && code <= 0x_d503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH |
7414 | - // (0x_d505 <= code && code <= 0x_d51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH |
7415 | - // (0x_d521 <= code && code <= 0x_d53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH |
7416 | - // (0x_d53D <= code && code <= 0x_d557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH |
7417 | - // (0x_d559 <= code && code <= 0x_d573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH |
7418 | - // (0x_d575 <= code && code <= 0x_d58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH |
7419 | - // (0x_d591 <= code && code <= 0x_d5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH |
7420 | - // (0x_d5AD <= code && code <= 0x_d5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH |
7421 | - // (0x_d5C9 <= code && code <= 0x_d5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH |
7422 | - // (0x_d5E5 <= code && code <= 0x_d5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH |
7423 | - // (0x_d601 <= code && code <= 0x_d61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH |
7424 | - // (0x_d61D <= code && code <= 0x_d637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH |
7425 | - // (0x_d639 <= code && code <= 0x_d653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH |
7426 | - // (0x_d655 <= code && code <= 0x_d66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH |
7427 | - // (0x_d671 <= code && code <= 0x_d68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH |
7428 | - // (0x_d68D <= code && code <= 0x_d6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH |
7429 | - // (0x_d6A9 <= code && code <= 0x_d6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH |
7430 | - // (0x_d6C5 <= code && code <= 0x_d6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH |
7431 | - // (0x_d6E1 <= code && code <= 0x_d6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH |
7432 | - // (0x_d6FD <= code && code <= 0x_d717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH |
7433 | - // (0x_d719 <= code && code <= 0x_d733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH |
7434 | - // (0x_d735 <= code && code <= 0x_d74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH |
7435 | - // (0x_d751 <= code && code <= 0x_d76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH |
7436 | - // (0x_d76D <= code && code <= 0x_d787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH |
7437 | - // (0x_d789 <= code && code <= 0x_d7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH |
7438 | - // ){ |
7439 | + // (0x_aC01 <= code && code <= 0x_aC1B) || // Lo [27] HANGUL SYLLABLE |
7440 | + // GAG..HANGUL SYLLABLE GAH (0x_aC1D <= code && code <= 0x_aC37) || // Lo |
7441 | + // [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH (0x_aC39 <= code && |
7442 | + // code <= 0x_aC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH |
7443 | + // (0x_aC55 <= code && code <= 0x_aC6F) || // Lo [27] HANGUL SYLLABLE |
7444 | + // GYAEG..HANGUL SYLLABLE GYAEH (0x_aC71 <= code && code <= 0x_aC8B) || |
7445 | + // // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH (0x_aC8D <= |
7446 | + // code && code <= 0x_aCA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE |
7447 | + // GEH (0x_aCA9 <= code && code <= 0x_aCC3) || // Lo [27] HANGUL |
7448 | + // SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH (0x_aCC5 <= code && code <= |
7449 | + // 0x_aCDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH |
7450 | + // (0x_aCE1 <= code && code <= 0x_aCFB) || // Lo [27] HANGUL SYLLABLE |
7451 | + // GOG..HANGUL SYLLABLE GOH (0x_aCFD <= code && code <= 0x_aD17) || // Lo |
7452 | + // [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH (0x_aD19 <= code && |
7453 | + // code <= 0x_aD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH |
7454 | + // (0x_aD35 <= code && code <= 0x_aD4F) || // Lo [27] HANGUL SYLLABLE |
7455 | + // GOEG..HANGUL SYLLABLE GOEH (0x_aD51 <= code && code <= 0x_aD6B) || // |
7456 | + // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH (0x_aD6D <= code |
7457 | + // && code <= 0x_aD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH |
7458 | + // (0x_aD89 <= code && code <= 0x_aDA3) || // Lo [27] HANGUL SYLLABLE |
7459 | + // GWEOG..HANGUL SYLLABLE GWEOH (0x_aDA5 <= code && code <= 0x_aDBF) || |
7460 | + // // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH (0x_aDC1 <= |
7461 | + // code && code <= 0x_aDDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE |
7462 | + // GWIH (0x_aDDD <= code && code <= 0x_aDF7) || // Lo [27] HANGUL |
7463 | + // SYLLABLE GYUG..HANGUL SYLLABLE GYUH (0x_aDF9 <= code && code <= |
7464 | + // 0x_aE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH |
7465 | + // (0x_aE15 <= code && code <= 0x_aE2F) || // Lo [27] HANGUL SYLLABLE |
7466 | + // GYIG..HANGUL SYLLABLE GYIH (0x_aE31 <= code && code <= 0x_aE4B) || // |
7467 | + // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH (0x_aE4D <= code && |
7468 | + // code <= 0x_aE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH |
7469 | + // (0x_aE69 <= code && code <= 0x_aE83) || // Lo [27] HANGUL SYLLABLE |
7470 | + // GGAEG..HANGUL SYLLABLE GGAEH (0x_aE85 <= code && code <= 0x_aE9F) || |
7471 | + // // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH (0x_aEA1 <= |
7472 | + // code && code <= 0x_aEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL |
7473 | + // SYLLABLE GGYAEH (0x_aEBD <= code && code <= 0x_aED7) || // Lo [27] |
7474 | + // HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH (0x_aED9 <= code && code |
7475 | + // <= 0x_aEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH |
7476 | + // (0x_aEF5 <= code && code <= 0x_aF0F) || // Lo [27] HANGUL SYLLABLE |
7477 | + // GGYEOG..HANGUL SYLLABLE GGYEOH (0x_aF11 <= code && code <= 0x_aF2B) || |
7478 | + // // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH (0x_aF2D <= |
7479 | + // code && code <= 0x_aF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE |
7480 | + // GGOH (0x_aF49 <= code && code <= 0x_aF63) || // Lo [27] HANGUL |
7481 | + // SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH (0x_aF65 <= code && code <= |
7482 | + // 0x_aF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH |
7483 | + // (0x_aF81 <= code && code <= 0x_aF9B) || // Lo [27] HANGUL SYLLABLE |
7484 | + // GGOEG..HANGUL SYLLABLE GGOEH (0x_aF9D <= code && code <= 0x_aFB7) || |
7485 | + // // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH (0x_aFB9 <= |
7486 | + // code && code <= 0x_aFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE |
7487 | + // GGUH (0x_aFD5 <= code && code <= 0x_aFEF) || // Lo [27] HANGUL |
7488 | + // SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH (0x_aFF1 <= code && code <= |
7489 | + // 0x_b00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH |
7490 | + // (0x_b00D <= code && code <= 0x_b027) || // Lo [27] HANGUL SYLLABLE |
7491 | + // GGWIG..HANGUL SYLLABLE GGWIH (0x_b029 <= code && code <= 0x_b043) || |
7492 | + // // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH (0x_b045 <= |
7493 | + // code && code <= 0x_b05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL |
7494 | + // SYLLABLE GGEUH (0x_b061 <= code && code <= 0x_b07B) || // Lo [27] |
7495 | + // HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH (0x_b07D <= code && code |
7496 | + // <= 0x_b097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH |
7497 | + // (0x_b099 <= code && code <= 0x_b0B3) || // Lo [27] HANGUL SYLLABLE |
7498 | + // NAG..HANGUL SYLLABLE NAH (0x_b0B5 <= code && code <= 0x_b0CF) || // Lo |
7499 | + // [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH (0x_b0D1 <= code && |
7500 | + // code <= 0x_b0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH |
7501 | + // (0x_b0ED <= code && code <= 0x_b107) || // Lo [27] HANGUL SYLLABLE |
7502 | + // NYAEG..HANGUL SYLLABLE NYAEH (0x_b109 <= code && code <= 0x_b123) || |
7503 | + // // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH (0x_b125 <= |
7504 | + // code && code <= 0x_b13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE |
7505 | + // NEH (0x_b141 <= code && code <= 0x_b15B) || // Lo [27] HANGUL |
7506 | + // SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH (0x_b15D <= code && code <= |
7507 | + // 0x_b177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH |
7508 | + // (0x_b179 <= code && code <= 0x_b193) || // Lo [27] HANGUL SYLLABLE |
7509 | + // NOG..HANGUL SYLLABLE NOH (0x_b195 <= code && code <= 0x_b1AF) || // Lo |
7510 | + // [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH (0x_b1B1 <= code && |
7511 | + // code <= 0x_b1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH |
7512 | + // (0x_b1CD <= code && code <= 0x_b1E7) || // Lo [27] HANGUL SYLLABLE |
7513 | + // NOEG..HANGUL SYLLABLE NOEH (0x_b1E9 <= code && code <= 0x_b203) || // |
7514 | + // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH (0x_b205 <= code |
7515 | + // && code <= 0x_b21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH |
7516 | + // (0x_b221 <= code && code <= 0x_b23B) || // Lo [27] HANGUL SYLLABLE |
7517 | + // NWEOG..HANGUL SYLLABLE NWEOH (0x_b23D <= code && code <= 0x_b257) || |
7518 | + // // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH (0x_b259 <= |
7519 | + // code && code <= 0x_b273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE |
7520 | + // NWIH (0x_b275 <= code && code <= 0x_b28F) || // Lo [27] HANGUL |
7521 | + // SYLLABLE NYUG..HANGUL SYLLABLE NYUH (0x_b291 <= code && code <= |
7522 | + // 0x_b2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH |
7523 | + // (0x_b2AD <= code && code <= 0x_b2C7) || // Lo [27] HANGUL SYLLABLE |
7524 | + // NYIG..HANGUL SYLLABLE NYIH (0x_b2C9 <= code && code <= 0x_b2E3) || // |
7525 | + // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH (0x_b2E5 <= code && |
7526 | + // code <= 0x_b2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH |
7527 | + // (0x_b301 <= code && code <= 0x_b31B) || // Lo [27] HANGUL SYLLABLE |
7528 | + // DAEG..HANGUL SYLLABLE DAEH (0x_b31D <= code && code <= 0x_b337) || // |
7529 | + // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH (0x_b339 <= code |
7530 | + // && code <= 0x_b353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE |
7531 | + // DYAEH (0x_b355 <= code && code <= 0x_b36F) || // Lo [27] HANGUL |
7532 | + // SYLLABLE DEOG..HANGUL SYLLABLE DEOH (0x_b371 <= code && code <= |
7533 | + // 0x_b38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH |
7534 | + // (0x_b38D <= code && code <= 0x_b3A7) || // Lo [27] HANGUL SYLLABLE |
7535 | + // DYEOG..HANGUL SYLLABLE DYEOH (0x_b3A9 <= code && code <= 0x_b3C3) || |
7536 | + // // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH (0x_b3C5 <= |
7537 | + // code && code <= 0x_b3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE |
7538 | + // DOH (0x_b3E1 <= code && code <= 0x_b3FB) || // Lo [27] HANGUL |
7539 | + // SYLLABLE DWAG..HANGUL SYLLABLE DWAH (0x_b3FD <= code && code <= |
7540 | + // 0x_b417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH |
7541 | + // (0x_b419 <= code && code <= 0x_b433) || // Lo [27] HANGUL SYLLABLE |
7542 | + // DOEG..HANGUL SYLLABLE DOEH (0x_b435 <= code && code <= 0x_b44F) || // |
7543 | + // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH (0x_b451 <= code |
7544 | + // && code <= 0x_b46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH |
7545 | + // (0x_b46D <= code && code <= 0x_b487) || // Lo [27] HANGUL SYLLABLE |
7546 | + // DWEOG..HANGUL SYLLABLE DWEOH (0x_b489 <= code && code <= 0x_b4A3) || |
7547 | + // // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH (0x_b4A5 <= |
7548 | + // code && code <= 0x_b4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE |
7549 | + // DWIH (0x_b4C1 <= code && code <= 0x_b4DB) || // Lo [27] HANGUL |
7550 | + // SYLLABLE DYUG..HANGUL SYLLABLE DYUH (0x_b4DD <= code && code <= |
7551 | + // 0x_b4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH |
7552 | + // (0x_b4F9 <= code && code <= 0x_b513) || // Lo [27] HANGUL SYLLABLE |
7553 | + // DYIG..HANGUL SYLLABLE DYIH (0x_b515 <= code && code <= 0x_b52F) || // |
7554 | + // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH (0x_b531 <= code && |
7555 | + // code <= 0x_b54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH |
7556 | + // (0x_b54D <= code && code <= 0x_b567) || // Lo [27] HANGUL SYLLABLE |
7557 | + // DDAEG..HANGUL SYLLABLE DDAEH (0x_b569 <= code && code <= 0x_b583) || |
7558 | + // // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH (0x_b585 <= |
7559 | + // code && code <= 0x_b59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL |
7560 | + // SYLLABLE DDYAEH (0x_b5A1 <= code && code <= 0x_b5BB) || // Lo [27] |
7561 | + // HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH (0x_b5BD <= code && code |
7562 | + // <= 0x_b5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH |
7563 | + // (0x_b5D9 <= code && code <= 0x_b5F3) || // Lo [27] HANGUL SYLLABLE |
7564 | + // DDYEOG..HANGUL SYLLABLE DDYEOH (0x_b5F5 <= code && code <= 0x_b60F) || |
7565 | + // // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH (0x_b611 <= |
7566 | + // code && code <= 0x_b62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE |
7567 | + // DDOH (0x_b62D <= code && code <= 0x_b647) || // Lo [27] HANGUL |
7568 | + // SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH (0x_b649 <= code && code <= |
7569 | + // 0x_b663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH |
7570 | + // (0x_b665 <= code && code <= 0x_b67F) || // Lo [27] HANGUL SYLLABLE |
7571 | + // DDOEG..HANGUL SYLLABLE DDOEH (0x_b681 <= code && code <= 0x_b69B) || |
7572 | + // // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH (0x_b69D <= |
7573 | + // code && code <= 0x_b6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE |
7574 | + // DDUH (0x_b6B9 <= code && code <= 0x_b6D3) || // Lo [27] HANGUL |
7575 | + // SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH (0x_b6D5 <= code && code <= |
7576 | + // 0x_b6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH |
7577 | + // (0x_b6F1 <= code && code <= 0x_b70B) || // Lo [27] HANGUL SYLLABLE |
7578 | + // DDWIG..HANGUL SYLLABLE DDWIH (0x_b70D <= code && code <= 0x_b727) || |
7579 | + // // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH (0x_b729 <= |
7580 | + // code && code <= 0x_b743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL |
7581 | + // SYLLABLE DDEUH (0x_b745 <= code && code <= 0x_b75F) || // Lo [27] |
7582 | + // HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH (0x_b761 <= code && code |
7583 | + // <= 0x_b77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH |
7584 | + // (0x_b77D <= code && code <= 0x_b797) || // Lo [27] HANGUL SYLLABLE |
7585 | + // RAG..HANGUL SYLLABLE RAH (0x_b799 <= code && code <= 0x_b7B3) || // Lo |
7586 | + // [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH (0x_b7B5 <= code && |
7587 | + // code <= 0x_b7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH |
7588 | + // (0x_b7D1 <= code && code <= 0x_b7EB) || // Lo [27] HANGUL SYLLABLE |
7589 | + // RYAEG..HANGUL SYLLABLE RYAEH (0x_b7ED <= code && code <= 0x_b807) || |
7590 | + // // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH (0x_b809 <= |
7591 | + // code && code <= 0x_b823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE |
7592 | + // REH (0x_b825 <= code && code <= 0x_b83F) || // Lo [27] HANGUL |
7593 | + // SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH (0x_b841 <= code && code <= |
7594 | + // 0x_b85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH |
7595 | + // (0x_b85D <= code && code <= 0x_b877) || // Lo [27] HANGUL SYLLABLE |
7596 | + // ROG..HANGUL SYLLABLE ROH (0x_b879 <= code && code <= 0x_b893) || // Lo |
7597 | + // [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH (0x_b895 <= code && |
7598 | + // code <= 0x_b8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH |
7599 | + // (0x_b8B1 <= code && code <= 0x_b8CB) || // Lo [27] HANGUL SYLLABLE |
7600 | + // ROEG..HANGUL SYLLABLE ROEH (0x_b8CD <= code && code <= 0x_b8E7) || // |
7601 | + // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH (0x_b8E9 <= code |
7602 | + // && code <= 0x_b903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH |
7603 | + // (0x_b905 <= code && code <= 0x_b91F) || // Lo [27] HANGUL SYLLABLE |
7604 | + // RWEOG..HANGUL SYLLABLE RWEOH (0x_b921 <= code && code <= 0x_b93B) || |
7605 | + // // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH (0x_b93D <= |
7606 | + // code && code <= 0x_b957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE |
7607 | + // RWIH (0x_b959 <= code && code <= 0x_b973) || // Lo [27] HANGUL |
7608 | + // SYLLABLE RYUG..HANGUL SYLLABLE RYUH (0x_b975 <= code && code <= |
7609 | + // 0x_b98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH |
7610 | + // (0x_b991 <= code && code <= 0x_b9AB) || // Lo [27] HANGUL SYLLABLE |
7611 | + // RYIG..HANGUL SYLLABLE RYIH (0x_b9AD <= code && code <= 0x_b9C7) || // |
7612 | + // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH (0x_b9C9 <= code && |
7613 | + // code <= 0x_b9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH |
7614 | + // (0x_b9E5 <= code && code <= 0x_b9FF) || // Lo [27] HANGUL SYLLABLE |
7615 | + // MAEG..HANGUL SYLLABLE MAEH (0x_bA01 <= code && code <= 0x_bA1B) || // |
7616 | + // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH (0x_bA1D <= code |
7617 | + // && code <= 0x_bA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE |
7618 | + // MYAEH (0x_bA39 <= code && code <= 0x_bA53) || // Lo [27] HANGUL |
7619 | + // SYLLABLE MEOG..HANGUL SYLLABLE MEOH (0x_bA55 <= code && code <= |
7620 | + // 0x_bA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH |
7621 | + // (0x_bA71 <= code && code <= 0x_bA8B) || // Lo [27] HANGUL SYLLABLE |
7622 | + // MYEOG..HANGUL SYLLABLE MYEOH (0x_bA8D <= code && code <= 0x_bAA7) || |
7623 | + // // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH (0x_bAA9 <= |
7624 | + // code && code <= 0x_bAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE |
7625 | + // MOH (0x_bAC5 <= code && code <= 0x_bADF) || // Lo [27] HANGUL |
7626 | + // SYLLABLE MWAG..HANGUL SYLLABLE MWAH (0x_bAE1 <= code && code <= |
7627 | + // 0x_bAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH |
7628 | + // (0x_bAFD <= code && code <= 0x_bB17) || // Lo [27] HANGUL SYLLABLE |
7629 | + // MOEG..HANGUL SYLLABLE MOEH (0x_bB19 <= code && code <= 0x_bB33) || // |
7630 | + // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH (0x_bB35 <= code |
7631 | + // && code <= 0x_bB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH |
7632 | + // (0x_bB51 <= code && code <= 0x_bB6B) || // Lo [27] HANGUL SYLLABLE |
7633 | + // MWEOG..HANGUL SYLLABLE MWEOH (0x_bB6D <= code && code <= 0x_bB87) || |
7634 | + // // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH (0x_bB89 <= |
7635 | + // code && code <= 0x_bBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE |
7636 | + // MWIH (0x_bBA5 <= code && code <= 0x_bBBF) || // Lo [27] HANGUL |
7637 | + // SYLLABLE MYUG..HANGUL SYLLABLE MYUH (0x_bBC1 <= code && code <= |
7638 | + // 0x_bBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH |
7639 | + // (0x_bBDD <= code && code <= 0x_bBF7) || // Lo [27] HANGUL SYLLABLE |
7640 | + // MYIG..HANGUL SYLLABLE MYIH (0x_bBF9 <= code && code <= 0x_bC13) || // |
7641 | + // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH (0x_bC15 <= code && |
7642 | + // code <= 0x_bC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH |
7643 | + // (0x_bC31 <= code && code <= 0x_bC4B) || // Lo [27] HANGUL SYLLABLE |
7644 | + // BAEG..HANGUL SYLLABLE BAEH (0x_bC4D <= code && code <= 0x_bC67) || // |
7645 | + // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH (0x_bC69 <= code |
7646 | + // && code <= 0x_bC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE |
7647 | + // BYAEH (0x_bC85 <= code && code <= 0x_bC9F) || // Lo [27] HANGUL |
7648 | + // SYLLABLE BEOG..HANGUL SYLLABLE BEOH (0x_bCA1 <= code && code <= |
7649 | + // 0x_bCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH |
7650 | + // (0x_bCBD <= code && code <= 0x_bCD7) || // Lo [27] HANGUL SYLLABLE |
7651 | + // BYEOG..HANGUL SYLLABLE BYEOH (0x_bCD9 <= code && code <= 0x_bCF3) || |
7652 | + // // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH (0x_bCF5 <= |
7653 | + // code && code <= 0x_bD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE |
7654 | + // BOH (0x_bD11 <= code && code <= 0x_bD2B) || // Lo [27] HANGUL |
7655 | + // SYLLABLE BWAG..HANGUL SYLLABLE BWAH (0x_bD2D <= code && code <= |
7656 | + // 0x_bD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH |
7657 | + // (0x_bD49 <= code && code <= 0x_bD63) || // Lo [27] HANGUL SYLLABLE |
7658 | + // BOEG..HANGUL SYLLABLE BOEH (0x_bD65 <= code && code <= 0x_bD7F) || // |
7659 | + // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH (0x_bD81 <= code |
7660 | + // && code <= 0x_bD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH |
7661 | + // (0x_bD9D <= code && code <= 0x_bDB7) || // Lo [27] HANGUL SYLLABLE |
7662 | + // BWEOG..HANGUL SYLLABLE BWEOH (0x_bDB9 <= code && code <= 0x_bDD3) || |
7663 | + // // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH (0x_bDD5 <= |
7664 | + // code && code <= 0x_bDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE |
7665 | + // BWIH (0x_bDF1 <= code && code <= 0x_bE0B) || // Lo [27] HANGUL |
7666 | + // SYLLABLE BYUG..HANGUL SYLLABLE BYUH (0x_bE0D <= code && code <= |
7667 | + // 0x_bE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH |
7668 | + // (0x_bE29 <= code && code <= 0x_bE43) || // Lo [27] HANGUL SYLLABLE |
7669 | + // BYIG..HANGUL SYLLABLE BYIH (0x_bE45 <= code && code <= 0x_bE5F) || // |
7670 | + // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH (0x_bE61 <= code && |
7671 | + // code <= 0x_bE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH |
7672 | + // (0x_bE7D <= code && code <= 0x_bE97) || // Lo [27] HANGUL SYLLABLE |
7673 | + // BBAEG..HANGUL SYLLABLE BBAEH (0x_bE99 <= code && code <= 0x_bEB3) || |
7674 | + // // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH (0x_bEB5 <= |
7675 | + // code && code <= 0x_bECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL |
7676 | + // SYLLABLE BBYAEH (0x_bED1 <= code && code <= 0x_bEEB) || // Lo [27] |
7677 | + // HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH (0x_bEED <= code && code |
7678 | + // <= 0x_bF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH |
7679 | + // (0x_bF09 <= code && code <= 0x_bF23) || // Lo [27] HANGUL SYLLABLE |
7680 | + // BBYEOG..HANGUL SYLLABLE BBYEOH (0x_bF25 <= code && code <= 0x_bF3F) || |
7681 | + // // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH (0x_bF41 <= |
7682 | + // code && code <= 0x_bF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE |
7683 | + // BBOH (0x_bF5D <= code && code <= 0x_bF77) || // Lo [27] HANGUL |
7684 | + // SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH (0x_bF79 <= code && code <= |
7685 | + // 0x_bF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH |
7686 | + // (0x_bF95 <= code && code <= 0x_bFAF) || // Lo [27] HANGUL SYLLABLE |
7687 | + // BBOEG..HANGUL SYLLABLE BBOEH (0x_bFB1 <= code && code <= 0x_bFCB) || |
7688 | + // // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH (0x_bFCD <= |
7689 | + // code && code <= 0x_bFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE |
7690 | + // BBUH (0x_bFE9 <= code && code <= 0x_c003) || // Lo [27] HANGUL |
7691 | + // SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH (0x_c005 <= code && code <= |
7692 | + // 0x_c01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH |
7693 | + // (0x_c021 <= code && code <= 0x_c03B) || // Lo [27] HANGUL SYLLABLE |
7694 | + // BBWIG..HANGUL SYLLABLE BBWIH (0x_c03D <= code && code <= 0x_c057) || |
7695 | + // // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH (0x_c059 <= |
7696 | + // code && code <= 0x_c073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL |
7697 | + // SYLLABLE BBEUH (0x_c075 <= code && code <= 0x_c08F) || // Lo [27] |
7698 | + // HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH (0x_c091 <= code && code |
7699 | + // <= 0x_c0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH |
7700 | + // (0x_c0AD <= code && code <= 0x_c0C7) || // Lo [27] HANGUL SYLLABLE |
7701 | + // SAG..HANGUL SYLLABLE SAH (0x_c0C9 <= code && code <= 0x_c0E3) || // Lo |
7702 | + // [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH (0x_c0E5 <= code && |
7703 | + // code <= 0x_c0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH |
7704 | + // (0x_c101 <= code && code <= 0x_c11B) || // Lo [27] HANGUL SYLLABLE |
7705 | + // SYAEG..HANGUL SYLLABLE SYAEH (0x_c11D <= code && code <= 0x_c137) || |
7706 | + // // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH (0x_c139 <= |
7707 | + // code && code <= 0x_c153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE |
7708 | + // SEH (0x_c155 <= code && code <= 0x_c16F) || // Lo [27] HANGUL |
7709 | + // SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH (0x_c171 <= code && code <= |
7710 | + // 0x_c18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH |
7711 | + // (0x_c18D <= code && code <= 0x_c1A7) || // Lo [27] HANGUL SYLLABLE |
7712 | + // SOG..HANGUL SYLLABLE SOH (0x_c1A9 <= code && code <= 0x_c1C3) || // Lo |
7713 | + // [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH (0x_c1C5 <= code && |
7714 | + // code <= 0x_c1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH |
7715 | + // (0x_c1E1 <= code && code <= 0x_c1FB) || // Lo [27] HANGUL SYLLABLE |
7716 | + // SOEG..HANGUL SYLLABLE SOEH (0x_c1FD <= code && code <= 0x_c217) || // |
7717 | + // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH (0x_c219 <= code |
7718 | + // && code <= 0x_c233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH |
7719 | + // (0x_c235 <= code && code <= 0x_c24F) || // Lo [27] HANGUL SYLLABLE |
7720 | + // SWEOG..HANGUL SYLLABLE SWEOH (0x_c251 <= code && code <= 0x_c26B) || |
7721 | + // // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH (0x_c26D <= |
7722 | + // code && code <= 0x_c287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE |
7723 | + // SWIH (0x_c289 <= code && code <= 0x_c2A3) || // Lo [27] HANGUL |
7724 | + // SYLLABLE SYUG..HANGUL SYLLABLE SYUH (0x_c2A5 <= code && code <= |
7725 | + // 0x_c2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH |
7726 | + // (0x_c2C1 <= code && code <= 0x_c2DB) || // Lo [27] HANGUL SYLLABLE |
7727 | + // SYIG..HANGUL SYLLABLE SYIH (0x_c2DD <= code && code <= 0x_c2F7) || // |
7728 | + // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH (0x_c2F9 <= code && |
7729 | + // code <= 0x_c313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH |
7730 | + // (0x_c315 <= code && code <= 0x_c32F) || // Lo [27] HANGUL SYLLABLE |
7731 | + // SSAEG..HANGUL SYLLABLE SSAEH (0x_c331 <= code && code <= 0x_c34B) || |
7732 | + // // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH (0x_c34D <= |
7733 | + // code && code <= 0x_c367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL |
7734 | + // SYLLABLE SSYAEH (0x_c369 <= code && code <= 0x_c383) || // Lo [27] |
7735 | + // HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH (0x_c385 <= code && code |
7736 | + // <= 0x_c39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH |
7737 | + // (0x_c3A1 <= code && code <= 0x_c3BB) || // Lo [27] HANGUL SYLLABLE |
7738 | + // SSYEOG..HANGUL SYLLABLE SSYEOH (0x_c3BD <= code && code <= 0x_c3D7) || |
7739 | + // // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH (0x_c3D9 <= |
7740 | + // code && code <= 0x_c3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE |
7741 | + // SSOH (0x_c3F5 <= code && code <= 0x_c40F) || // Lo [27] HANGUL |
7742 | + // SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH (0x_c411 <= code && code <= |
7743 | + // 0x_c42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH |
7744 | + // (0x_c42D <= code && code <= 0x_c447) || // Lo [27] HANGUL SYLLABLE |
7745 | + // SSOEG..HANGUL SYLLABLE SSOEH (0x_c449 <= code && code <= 0x_c463) || |
7746 | + // // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH (0x_c465 <= |
7747 | + // code && code <= 0x_c47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE |
7748 | + // SSUH (0x_c481 <= code && code <= 0x_c49B) || // Lo [27] HANGUL |
7749 | + // SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH (0x_c49D <= code && code <= |
7750 | + // 0x_c4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH |
7751 | + // (0x_c4B9 <= code && code <= 0x_c4D3) || // Lo [27] HANGUL SYLLABLE |
7752 | + // SSWIG..HANGUL SYLLABLE SSWIH (0x_c4D5 <= code && code <= 0x_c4EF) || |
7753 | + // // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH (0x_c4F1 <= |
7754 | + // code && code <= 0x_c50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL |
7755 | + // SYLLABLE SSEUH (0x_c50D <= code && code <= 0x_c527) || // Lo [27] |
7756 | + // HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH (0x_c529 <= code && code |
7757 | + // <= 0x_c543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH |
7758 | + // (0x_c545 <= code && code <= 0x_c55F) || // Lo [27] HANGUL SYLLABLE |
7759 | + // AG..HANGUL SYLLABLE AH (0x_c561 <= code && code <= 0x_c57B) || // Lo |
7760 | + // [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH (0x_c57D <= code && code |
7761 | + // <= 0x_c597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH |
7762 | + // (0x_c599 <= code && code <= 0x_c5B3) || // Lo [27] HANGUL SYLLABLE |
7763 | + // YAEG..HANGUL SYLLABLE YAEH (0x_c5B5 <= code && code <= 0x_c5CF) || // |
7764 | + // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH (0x_c5D1 <= code && |
7765 | + // code <= 0x_c5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH |
7766 | + // (0x_c5ED <= code && code <= 0x_c607) || // Lo [27] HANGUL SYLLABLE |
7767 | + // YEOG..HANGUL SYLLABLE YEOH (0x_c609 <= code && code <= 0x_c623) || // |
7768 | + // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH (0x_c625 <= code && |
7769 | + // code <= 0x_c63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH |
7770 | + // (0x_c641 <= code && code <= 0x_c65B) || // Lo [27] HANGUL SYLLABLE |
7771 | + // WAG..HANGUL SYLLABLE WAH (0x_c65D <= code && code <= 0x_c677) || // Lo |
7772 | + // [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH (0x_c679 <= code && |
7773 | + // code <= 0x_c693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH |
7774 | + // (0x_c695 <= code && code <= 0x_c6AF) || // Lo [27] HANGUL SYLLABLE |
7775 | + // YOG..HANGUL SYLLABLE YOH (0x_c6B1 <= code && code <= 0x_c6CB) || // Lo |
7776 | + // [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH (0x_c6CD <= code && code |
7777 | + // <= 0x_c6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH |
7778 | + // (0x_c6E9 <= code && code <= 0x_c703) || // Lo [27] HANGUL SYLLABLE |
7779 | + // WEG..HANGUL SYLLABLE WEH (0x_c705 <= code && code <= 0x_c71F) || // Lo |
7780 | + // [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH (0x_c721 <= code && code |
7781 | + // <= 0x_c73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH |
7782 | + // (0x_c73D <= code && code <= 0x_c757) || // Lo [27] HANGUL SYLLABLE |
7783 | + // EUG..HANGUL SYLLABLE EUH (0x_c759 <= code && code <= 0x_c773) || // Lo |
7784 | + // [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH (0x_c775 <= code && code |
7785 | + // <= 0x_c78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH |
7786 | + // (0x_c791 <= code && code <= 0x_c7AB) || // Lo [27] HANGUL SYLLABLE |
7787 | + // JAG..HANGUL SYLLABLE JAH (0x_c7AD <= code && code <= 0x_c7C7) || // Lo |
7788 | + // [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH (0x_c7C9 <= code && |
7789 | + // code <= 0x_c7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH |
7790 | + // (0x_c7E5 <= code && code <= 0x_c7FF) || // Lo [27] HANGUL SYLLABLE |
7791 | + // JYAEG..HANGUL SYLLABLE JYAEH (0x_c801 <= code && code <= 0x_c81B) || |
7792 | + // // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH (0x_c81D <= |
7793 | + // code && code <= 0x_c837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE |
7794 | + // JEH (0x_c839 <= code && code <= 0x_c853) || // Lo [27] HANGUL |
7795 | + // SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH (0x_c855 <= code && code <= |
7796 | + // 0x_c86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH |
7797 | + // (0x_c871 <= code && code <= 0x_c88B) || // Lo [27] HANGUL SYLLABLE |
7798 | + // JOG..HANGUL SYLLABLE JOH (0x_c88D <= code && code <= 0x_c8A7) || // Lo |
7799 | + // [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH (0x_c8A9 <= code && |
7800 | + // code <= 0x_c8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH |
7801 | + // (0x_c8C5 <= code && code <= 0x_c8DF) || // Lo [27] HANGUL SYLLABLE |
7802 | + // JOEG..HANGUL SYLLABLE JOEH (0x_c8E1 <= code && code <= 0x_c8FB) || // |
7803 | + // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH (0x_c8FD <= code |
7804 | + // && code <= 0x_c917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH |
7805 | + // (0x_c919 <= code && code <= 0x_c933) || // Lo [27] HANGUL SYLLABLE |
7806 | + // JWEOG..HANGUL SYLLABLE JWEOH (0x_c935 <= code && code <= 0x_c94F) || |
7807 | + // // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH (0x_c951 <= |
7808 | + // code && code <= 0x_c96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE |
7809 | + // JWIH (0x_c96D <= code && code <= 0x_c987) || // Lo [27] HANGUL |
7810 | + // SYLLABLE JYUG..HANGUL SYLLABLE JYUH (0x_c989 <= code && code <= |
7811 | + // 0x_c9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH |
7812 | + // (0x_c9A5 <= code && code <= 0x_c9BF) || // Lo [27] HANGUL SYLLABLE |
7813 | + // JYIG..HANGUL SYLLABLE JYIH (0x_c9C1 <= code && code <= 0x_c9DB) || // |
7814 | + // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH (0x_c9DD <= code && |
7815 | + // code <= 0x_c9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH |
7816 | + // (0x_c9F9 <= code && code <= 0x_cA13) || // Lo [27] HANGUL SYLLABLE |
7817 | + // JJAEG..HANGUL SYLLABLE JJAEH (0x_cA15 <= code && code <= 0x_cA2F) || |
7818 | + // // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH (0x_cA31 <= |
7819 | + // code && code <= 0x_cA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL |
7820 | + // SYLLABLE JJYAEH (0x_cA4D <= code && code <= 0x_cA67) || // Lo [27] |
7821 | + // HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH (0x_cA69 <= code && code |
7822 | + // <= 0x_cA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH |
7823 | + // (0x_cA85 <= code && code <= 0x_cA9F) || // Lo [27] HANGUL SYLLABLE |
7824 | + // JJYEOG..HANGUL SYLLABLE JJYEOH (0x_cAA1 <= code && code <= 0x_cABB) || |
7825 | + // // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH (0x_cABD <= |
7826 | + // code && code <= 0x_cAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE |
7827 | + // JJOH (0x_cAD9 <= code && code <= 0x_cAF3) || // Lo [27] HANGUL |
7828 | + // SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH (0x_cAF5 <= code && code <= |
7829 | + // 0x_cB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH |
7830 | + // (0x_cB11 <= code && code <= 0x_cB2B) || // Lo [27] HANGUL SYLLABLE |
7831 | + // JJOEG..HANGUL SYLLABLE JJOEH (0x_cB2D <= code && code <= 0x_cB47) || |
7832 | + // // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH (0x_cB49 <= |
7833 | + // code && code <= 0x_cB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE |
7834 | + // JJUH (0x_cB65 <= code && code <= 0x_cB7F) || // Lo [27] HANGUL |
7835 | + // SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH (0x_cB81 <= code && code <= |
7836 | + // 0x_cB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH |
7837 | + // (0x_cB9D <= code && code <= 0x_cBB7) || // Lo [27] HANGUL SYLLABLE |
7838 | + // JJWIG..HANGUL SYLLABLE JJWIH (0x_cBB9 <= code && code <= 0x_cBD3) || |
7839 | + // // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH (0x_cBD5 <= |
7840 | + // code && code <= 0x_cBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL |
7841 | + // SYLLABLE JJEUH (0x_cBF1 <= code && code <= 0x_cC0B) || // Lo [27] |
7842 | + // HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH (0x_cC0D <= code && code |
7843 | + // <= 0x_cC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH |
7844 | + // (0x_cC29 <= code && code <= 0x_cC43) || // Lo [27] HANGUL SYLLABLE |
7845 | + // CAG..HANGUL SYLLABLE CAH (0x_cC45 <= code && code <= 0x_cC5F) || // Lo |
7846 | + // [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH (0x_cC61 <= code && |
7847 | + // code <= 0x_cC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH |
7848 | + // (0x_cC7D <= code && code <= 0x_cC97) || // Lo [27] HANGUL SYLLABLE |
7849 | + // CYAEG..HANGUL SYLLABLE CYAEH (0x_cC99 <= code && code <= 0x_cCB3) || |
7850 | + // // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH (0x_cCB5 <= |
7851 | + // code && code <= 0x_cCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE |
7852 | + // CEH (0x_cCD1 <= code && code <= 0x_cCEB) || // Lo [27] HANGUL |
7853 | + // SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH (0x_cCED <= code && code <= |
7854 | + // 0x_cD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH |
7855 | + // (0x_cD09 <= code && code <= 0x_cD23) || // Lo [27] HANGUL SYLLABLE |
7856 | + // COG..HANGUL SYLLABLE COH (0x_cD25 <= code && code <= 0x_cD3F) || // Lo |
7857 | + // [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH (0x_cD41 <= code && |
7858 | + // code <= 0x_cD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH |
7859 | + // (0x_cD5D <= code && code <= 0x_cD77) || // Lo [27] HANGUL SYLLABLE |
7860 | + // COEG..HANGUL SYLLABLE COEH (0x_cD79 <= code && code <= 0x_cD93) || // |
7861 | + // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH (0x_cD95 <= code |
7862 | + // && code <= 0x_cDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH |
7863 | + // (0x_cDB1 <= code && code <= 0x_cDCB) || // Lo [27] HANGUL SYLLABLE |
7864 | + // CWEOG..HANGUL SYLLABLE CWEOH (0x_cDCD <= code && code <= 0x_cDE7) || |
7865 | + // // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH (0x_cDE9 <= |
7866 | + // code && code <= 0x_cE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE |
7867 | + // CWIH (0x_cE05 <= code && code <= 0x_cE1F) || // Lo [27] HANGUL |
7868 | + // SYLLABLE CYUG..HANGUL SYLLABLE CYUH (0x_cE21 <= code && code <= |
7869 | + // 0x_cE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH |
7870 | + // (0x_cE3D <= code && code <= 0x_cE57) || // Lo [27] HANGUL SYLLABLE |
7871 | + // CYIG..HANGUL SYLLABLE CYIH (0x_cE59 <= code && code <= 0x_cE73) || // |
7872 | + // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH (0x_cE75 <= code && |
7873 | + // code <= 0x_cE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH |
7874 | + // (0x_cE91 <= code && code <= 0x_cEAB) || // Lo [27] HANGUL SYLLABLE |
7875 | + // KAEG..HANGUL SYLLABLE KAEH (0x_cEAD <= code && code <= 0x_cEC7) || // |
7876 | + // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH (0x_cEC9 <= code |
7877 | + // && code <= 0x_cEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE |
7878 | + // KYAEH (0x_cEE5 <= code && code <= 0x_cEFF) || // Lo [27] HANGUL |
7879 | + // SYLLABLE KEOG..HANGUL SYLLABLE KEOH (0x_cF01 <= code && code <= |
7880 | + // 0x_cF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH |
7881 | + // (0x_cF1D <= code && code <= 0x_cF37) || // Lo [27] HANGUL SYLLABLE |
7882 | + // KYEOG..HANGUL SYLLABLE KYEOH (0x_cF39 <= code && code <= 0x_cF53) || |
7883 | + // // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH (0x_cF55 <= |
7884 | + // code && code <= 0x_cF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE |
7885 | + // KOH (0x_cF71 <= code && code <= 0x_cF8B) || // Lo [27] HANGUL |
7886 | + // SYLLABLE KWAG..HANGUL SYLLABLE KWAH (0x_cF8D <= code && code <= |
7887 | + // 0x_cFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH |
7888 | + // (0x_cFA9 <= code && code <= 0x_cFC3) || // Lo [27] HANGUL SYLLABLE |
7889 | + // KOEG..HANGUL SYLLABLE KOEH (0x_cFC5 <= code && code <= 0x_cFDF) || // |
7890 | + // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH (0x_cFE1 <= code |
7891 | + // && code <= 0x_cFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH |
7892 | + // (0x_cFFD <= code && code <= 0x_d017) || // Lo [27] HANGUL SYLLABLE |
7893 | + // KWEOG..HANGUL SYLLABLE KWEOH (0x_d019 <= code && code <= 0x_d033) || |
7894 | + // // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH (0x_d035 <= |
7895 | + // code && code <= 0x_d04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE |
7896 | + // KWIH (0x_d051 <= code && code <= 0x_d06B) || // Lo [27] HANGUL |
7897 | + // SYLLABLE KYUG..HANGUL SYLLABLE KYUH (0x_d06D <= code && code <= |
7898 | + // 0x_d087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH |
7899 | + // (0x_d089 <= code && code <= 0x_d0A3) || // Lo [27] HANGUL SYLLABLE |
7900 | + // KYIG..HANGUL SYLLABLE KYIH (0x_d0A5 <= code && code <= 0x_d0BF) || // |
7901 | + // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH (0x_d0C1 <= code && |
7902 | + // code <= 0x_d0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH |
7903 | + // (0x_d0DD <= code && code <= 0x_d0F7) || // Lo [27] HANGUL SYLLABLE |
7904 | + // TAEG..HANGUL SYLLABLE TAEH (0x_d0F9 <= code && code <= 0x_d113) || // |
7905 | + // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH (0x_d115 <= code |
7906 | + // && code <= 0x_d12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE |
7907 | + // TYAEH (0x_d131 <= code && code <= 0x_d14B) || // Lo [27] HANGUL |
7908 | + // SYLLABLE TEOG..HANGUL SYLLABLE TEOH (0x_d14D <= code && code <= |
7909 | + // 0x_d167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH |
7910 | + // (0x_d169 <= code && code <= 0x_d183) || // Lo [27] HANGUL SYLLABLE |
7911 | + // TYEOG..HANGUL SYLLABLE TYEOH (0x_d185 <= code && code <= 0x_d19F) || |
7912 | + // // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH (0x_d1A1 <= |
7913 | + // code && code <= 0x_d1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE |
7914 | + // TOH (0x_d1BD <= code && code <= 0x_d1D7) || // Lo [27] HANGUL |
7915 | + // SYLLABLE TWAG..HANGUL SYLLABLE TWAH (0x_d1D9 <= code && code <= |
7916 | + // 0x_d1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH |
7917 | + // (0x_d1F5 <= code && code <= 0x_d20F) || // Lo [27] HANGUL SYLLABLE |
7918 | + // TOEG..HANGUL SYLLABLE TOEH (0x_d211 <= code && code <= 0x_d22B) || // |
7919 | + // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH (0x_d22D <= code |
7920 | + // && code <= 0x_d247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH |
7921 | + // (0x_d249 <= code && code <= 0x_d263) || // Lo [27] HANGUL SYLLABLE |
7922 | + // TWEOG..HANGUL SYLLABLE TWEOH (0x_d265 <= code && code <= 0x_d27F) || |
7923 | + // // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH (0x_d281 <= |
7924 | + // code && code <= 0x_d29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE |
7925 | + // TWIH (0x_d29D <= code && code <= 0x_d2B7) || // Lo [27] HANGUL |
7926 | + // SYLLABLE TYUG..HANGUL SYLLABLE TYUH (0x_d2B9 <= code && code <= |
7927 | + // 0x_d2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH |
7928 | + // (0x_d2D5 <= code && code <= 0x_d2EF) || // Lo [27] HANGUL SYLLABLE |
7929 | + // TYIG..HANGUL SYLLABLE TYIH (0x_d2F1 <= code && code <= 0x_d30B) || // |
7930 | + // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH (0x_d30D <= code && |
7931 | + // code <= 0x_d327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH |
7932 | + // (0x_d329 <= code && code <= 0x_d343) || // Lo [27] HANGUL SYLLABLE |
7933 | + // PAEG..HANGUL SYLLABLE PAEH (0x_d345 <= code && code <= 0x_d35F) || // |
7934 | + // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH (0x_d361 <= code |
7935 | + // && code <= 0x_d37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE |
7936 | + // PYAEH (0x_d37D <= code && code <= 0x_d397) || // Lo [27] HANGUL |
7937 | + // SYLLABLE PEOG..HANGUL SYLLABLE PEOH (0x_d399 <= code && code <= |
7938 | + // 0x_d3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH |
7939 | + // (0x_d3B5 <= code && code <= 0x_d3CF) || // Lo [27] HANGUL SYLLABLE |
7940 | + // PYEOG..HANGUL SYLLABLE PYEOH (0x_d3D1 <= code && code <= 0x_d3EB) || |
7941 | + // // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH (0x_d3ED <= |
7942 | + // code && code <= 0x_d407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE |
7943 | + // POH (0x_d409 <= code && code <= 0x_d423) || // Lo [27] HANGUL |
7944 | + // SYLLABLE PWAG..HANGUL SYLLABLE PWAH (0x_d425 <= code && code <= |
7945 | + // 0x_d43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH |
7946 | + // (0x_d441 <= code && code <= 0x_d45B) || // Lo [27] HANGUL SYLLABLE |
7947 | + // POEG..HANGUL SYLLABLE POEH (0x_d45D <= code && code <= 0x_d477) || // |
7948 | + // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH (0x_d479 <= code |
7949 | + // && code <= 0x_d493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH |
7950 | + // (0x_d495 <= code && code <= 0x_d4AF) || // Lo [27] HANGUL SYLLABLE |
7951 | + // PWEOG..HANGUL SYLLABLE PWEOH (0x_d4B1 <= code && code <= 0x_d4CB) || |
7952 | + // // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH (0x_d4CD <= |
7953 | + // code && code <= 0x_d4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE |
7954 | + // PWIH (0x_d4E9 <= code && code <= 0x_d503) || // Lo [27] HANGUL |
7955 | + // SYLLABLE PYUG..HANGUL SYLLABLE PYUH (0x_d505 <= code && code <= |
7956 | + // 0x_d51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH |
7957 | + // (0x_d521 <= code && code <= 0x_d53B) || // Lo [27] HANGUL SYLLABLE |
7958 | + // PYIG..HANGUL SYLLABLE PYIH (0x_d53D <= code && code <= 0x_d557) || // |
7959 | + // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH (0x_d559 <= code && |
7960 | + // code <= 0x_d573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH |
7961 | + // (0x_d575 <= code && code <= 0x_d58F) || // Lo [27] HANGUL SYLLABLE |
7962 | + // HAEG..HANGUL SYLLABLE HAEH (0x_d591 <= code && code <= 0x_d5AB) || // |
7963 | + // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH (0x_d5AD <= code |
7964 | + // && code <= 0x_d5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE |
7965 | + // HYAEH (0x_d5C9 <= code && code <= 0x_d5E3) || // Lo [27] HANGUL |
7966 | + // SYLLABLE HEOG..HANGUL SYLLABLE HEOH (0x_d5E5 <= code && code <= |
7967 | + // 0x_d5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH |
7968 | + // (0x_d601 <= code && code <= 0x_d61B) || // Lo [27] HANGUL SYLLABLE |
7969 | + // HYEOG..HANGUL SYLLABLE HYEOH (0x_d61D <= code && code <= 0x_d637) || |
7970 | + // // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH (0x_d639 <= |
7971 | + // code && code <= 0x_d653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE |
7972 | + // HOH (0x_d655 <= code && code <= 0x_d66F) || // Lo [27] HANGUL |
7973 | + // SYLLABLE HWAG..HANGUL SYLLABLE HWAH (0x_d671 <= code && code <= |
7974 | + // 0x_d68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH |
7975 | + // (0x_d68D <= code && code <= 0x_d6A7) || // Lo [27] HANGUL SYLLABLE |
7976 | + // HOEG..HANGUL SYLLABLE HOEH (0x_d6A9 <= code && code <= 0x_d6C3) || // |
7977 | + // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH (0x_d6C5 <= code |
7978 | + // && code <= 0x_d6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH |
7979 | + // (0x_d6E1 <= code && code <= 0x_d6FB) || // Lo [27] HANGUL SYLLABLE |
7980 | + // HWEOG..HANGUL SYLLABLE HWEOH (0x_d6FD <= code && code <= 0x_d717) || |
7981 | + // // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH (0x_d719 <= |
7982 | + // code && code <= 0x_d733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE |
7983 | + // HWIH (0x_d735 <= code && code <= 0x_d74F) || // Lo [27] HANGUL |
7984 | + // SYLLABLE HYUG..HANGUL SYLLABLE HYUH (0x_d751 <= code && code <= |
7985 | + // 0x_d76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH |
7986 | + // (0x_d76D <= code && code <= 0x_d787) || // Lo [27] HANGUL SYLLABLE |
7987 | + // HYIG..HANGUL SYLLABLE HYIH (0x_d789 <= code && code <= 0x_d7A3) // Lo |
7988 | + // [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH ){ |
7989 | // return LVT; |
7990 | // } |
7991 | // |
7992 | // if( |
7993 | // 0x261D == code || // So WHITE UP POINTING INDEX |
7994 | // 0x26F9 == code || // So PERSON WITH BALL |
7995 | - // (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND |
7996 | - // 0x1F385 == code || // So FATHER CHRISTMAS |
7997 | - // (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER |
7998 | - // 0x1F3C7 == code || // So HORSE RACING |
7999 | + // (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING |
8000 | + // HAND 0x1F385 == code || // So FATHER CHRISTMAS |
8001 | + // (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] |
8002 | + // SNOWBOARDER..SURFER 0x1F3C7 == code || // So HORSE RACING |
8003 | // (0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER |
8004 | // (0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE |
8005 | - // (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN |
8006 | - // 0x1F46E == code || // So POLICE OFFICER |
8007 | - // (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS |
8008 | - // 0x1F47C == code || // So BABY ANGEL |
8009 | - // (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER |
8010 | - // (0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT |
8011 | - // 0x1F4AA == code || // So FLEXED BICEPS |
8012 | - // (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY |
8013 | - // 0x1F57A == code || // So MAN DANCING |
8014 | - // 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED |
8015 | - // (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS |
8016 | - // (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY |
8017 | - // (0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS |
8018 | - // 0x1F6A3 == code || // So ROWBOAT |
8019 | - // (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN |
8020 | - // 0x1F6C0 == code || // So BATH |
8021 | + // (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING |
8022 | + // BACKHAND INDEX..OPEN HANDS SIGN 0x1F46E == code || // So POLICE |
8023 | + // OFFICER (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH |
8024 | + // VEIL..PRINCESS 0x1F47C == code || // So BABY ANGEL |
8025 | + // (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK |
8026 | + // PERSON..DANCER (0x1F485 <= code && code <= 0x1F487) || // So [3] |
8027 | + // NAIL POLISH..HAIRCUT 0x1F4AA == code || // So FLEXED BICEPS |
8028 | + // (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS |
8029 | + // SUIT LEVITATING..SLEUTH OR SPY 0x1F57A == code || // So MAN |
8030 | + // DANCING 0x1F590 == code || // So RAISED HAND WITH FINGERS |
8031 | + // SPLAYED (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED |
8032 | + // HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND |
8033 | + // RING FINGERS (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE |
8034 | + // WITH NO GOOD GESTURE..PERSON BOWING DEEPLY (0x1F64B <= code && code <= |
8035 | + // 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED |
8036 | + // HANDS 0x1F6A3 == code || // So ROWBOAT |
8037 | + // (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] |
8038 | + // BICYCLIST..PEDESTRIAN 0x1F6C0 == code || // So BATH |
8039 | // 0x1F6CC == code || // So SLEEPING ACCOMMODATION |
8040 | - // (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST |
8041 | - // (0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN |
8042 | + // (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE |
8043 | + // HORNS..RIGHT-FACING FIST (0x1F91E <= code && code <= 0x1F91F) || // So |
8044 | + // [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN |
8045 | // 0x1F926 == code || // So FACE PALM |
8046 | - // (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING |
8047 | - // (0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL |
8048 | - // (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF |
8049 | - // ){ |
8050 | + // (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT |
8051 | + // WOMAN..JUGGLING (0x1F93D <= code && code <= 0x1F93E) || // So [2] |
8052 | + // WATER POLO..HANDBALL (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] |
8053 | + // ADULT..ELF ){ |
8054 | // return E_Base; |
8055 | // } |
8056 | // |
8057 | // if( |
8058 | - // (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 |
8059 | - // ){ |
8060 | + // (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER |
8061 | + // FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 ){ |
8062 | // return E_Modifier; |
8063 | // } |
8064 | // |
8065 | @@ -1851,8 +2140,8 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
8066 | // if( |
8067 | // 0x2640 == code || // So FEMALE SIGN |
8068 | // 0x2642 == code || // So MALE SIGN |
8069 | - // (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES |
8070 | - // 0x2708 == code || // So AIRPLANE |
8071 | + // (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF |
8072 | + // AESCULAPIUS..SCALES 0x2708 == code || // So AIRPLANE |
8073 | // 0x2764 == code || // So HEAVY BLACK HEART |
8074 | // 0x1F308 == code || // So RAINBOW |
8075 | // 0x1F33E == code || // So EAR OF RICE |
8076 | @@ -1863,8 +2152,8 @@ pub fn word_break_string(s: &str, width: usize) -> Vec<&str> { |
8077 | // 0x1F3EB == code || // So SCHOOL |
8078 | // 0x1F3ED == code || // So FACTORY |
8079 | // 0x1F48B == code || // So KISS MARK |
8080 | - // (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE |
8081 | - // 0x1F527 == code || // So WRENCH |
8082 | + // (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL |
8083 | + // COMPUTER..BRIEFCASE 0x1F527 == code || // So WRENCH |
8084 | // 0x1F52C == code || // So MICROSCOPE |
8085 | // 0x1F5E8 == code || // So LEFT SPEECH BUBBLE |
8086 | // 0x1F680 == code || // So ROCKET |
8087 | diff --git a/melib/src/text_processing/line_break.rs b/melib/src/text_processing/line_break.rs |
8088 | index f35d827..ff7cb35 100644 |
8089 | --- a/melib/src/text_processing/line_break.rs |
8090 | +++ b/melib/src/text_processing/line_break.rs |
8091 | @@ -20,17 +20,18 @@ |
8092 | */ |
8093 | |
8094 | extern crate unicode_segmentation; |
8095 | - use self::unicode_segmentation::UnicodeSegmentation; |
8096 | - use super::grapheme_clusters::TextProcessing; |
8097 | - use super::tables::LINE_BREAK_RULES; |
8098 | - use super::types::LineBreakClass; |
8099 | - use super::types::Reflow; |
8100 | - use core::cmp::Ordering; |
8101 | - use core::iter::Peekable; |
8102 | - use core::str::FromStr; |
8103 | + use core::{cmp::Ordering, iter::Peekable, str::FromStr}; |
8104 | use std::collections::VecDeque; |
8105 | + |
8106 | use LineBreakClass::*; |
8107 | |
8108 | + use self::unicode_segmentation::UnicodeSegmentation; |
8109 | + use super::{ |
8110 | + grapheme_clusters::TextProcessing, |
8111 | + tables::LINE_BREAK_RULES, |
8112 | + types::{LineBreakClass, Reflow}, |
8113 | + }; |
8114 | + |
8115 | #[derive(Debug, PartialEq, Copy, Clone)] |
8116 | pub enum LineBreakCandidate { |
8117 | MandatoryBreak, |
8118 | @@ -138,14 +139,32 @@ impl EvenAfterSpaces for str { |
8119 | /// Returns positions where breaks can happen |
8120 | /// Examples: |
8121 | /// ``` |
8122 | - /// use melib::text_processing::{self, LineBreakCandidate::{self, *}}; |
8123 | - /// use melib::text_processing::line_break::LineBreakCandidateIter; |
8124 | + /// use melib::text_processing::{ |
8125 | + /// self, |
8126 | + /// line_break::LineBreakCandidateIter, |
8127 | + /// LineBreakCandidate::{self, *}, |
8128 | + /// }; |
8129 | /// |
8130 | - /// assert!(LineBreakCandidateIter::new("").collect::<Vec<(usize, LineBreakCandidate)>>().is_empty()); |
8131 | - /// assert_eq!(&[(7, BreakAllowed), (12, MandatoryBreak)], |
8132 | - /// LineBreakCandidateIter::new("Sample Text.").collect::<Vec<(usize, LineBreakCandidate)>>().as_slice()); |
8133 | - /// assert_eq!(&[(3, MandatoryBreak), (7, MandatoryBreak), (10, BreakAllowed), (17, MandatoryBreak)], |
8134 | - /// LineBreakCandidateIter::new("Sa\nmp\r\nle T(e)xt.").collect::<Vec<(usize, LineBreakCandidate)>>().as_slice()); |
8135 | + /// assert!(LineBreakCandidateIter::new("") |
8136 | + /// .collect::<Vec<(usize, LineBreakCandidate)>>() |
8137 | + /// .is_empty()); |
8138 | + /// assert_eq!( |
8139 | + /// &[(7, BreakAllowed), (12, MandatoryBreak)], |
8140 | + /// LineBreakCandidateIter::new("Sample Text.") |
8141 | + /// .collect::<Vec<(usize, LineBreakCandidate)>>() |
8142 | + /// .as_slice() |
8143 | + /// ); |
8144 | + /// assert_eq!( |
8145 | + /// &[ |
8146 | + /// (3, MandatoryBreak), |
8147 | + /// (7, MandatoryBreak), |
8148 | + /// (10, BreakAllowed), |
8149 | + /// (17, MandatoryBreak) |
8150 | + /// ], |
8151 | + /// LineBreakCandidateIter::new("Sa\nmp\r\nle T(e)xt.") |
8152 | + /// .collect::<Vec<(usize, LineBreakCandidate)>>() |
8153 | + /// .as_slice() |
8154 | + /// ); |
8155 | /// ``` |
8156 | impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8157 | type Item = (usize, LineBreakCandidate); |
8158 | @@ -190,13 +209,13 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8159 | *reg_ind_streak = 0; |
8160 | } |
8161 | |
8162 | - /* LB1 Assign a line breaking class to each code point of the input. Resolve AI, CB, CJ, |
8163 | - * SA, SG, and XX into other line breaking classes depending on criteria outside the scope |
8164 | - * of this algorithm. |
8165 | + /* LB1 Assign a line breaking class to each code point of the input. Resolve |
8166 | + * AI, CB, CJ, SA, SG, and XX into other line breaking classes |
8167 | + * depending on criteria outside the scope of this algorithm. |
8168 | * |
8169 | - * In the absence of such criteria all characters with a specific combination of original |
8170 | - * class and General_Category property value are resolved as follows: |
8171 | - * Resolved Original General_Category |
8172 | + * In the absence of such criteria all characters with a specific combination |
8173 | + * of original class and General_Category property value are |
8174 | + * resolved as follows: Resolved Original General_Category |
8175 | * AL AI, SG, XX Any |
8176 | * CM SA Only Mn or Mc |
8177 | * AL SA Any except Mn and Mc |
8178 | @@ -245,7 +264,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8179 | continue; |
8180 | } |
8181 | WJ => { |
8182 | - /*: LB11 Do not break before or after Word joiner and related characters.*/ |
8183 | + /* : LB11 Do not break before or after Word joiner and related |
8184 | + * characters. */ |
8185 | *pos += grapheme.len(); |
8186 | continue; |
8187 | } |
8188 | @@ -266,8 +286,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8189 | } |
8190 | match class { |
8191 | ZW => { |
8192 | - // LB8 Break before any character following a zero-width space, even if one or more |
8193 | - // spaces intervene |
8194 | + // LB8 Break before any character following a zero-width space, even if one or |
8195 | + // more spaces intervene |
8196 | // ZW SP* ÷ |
8197 | *pos += grapheme.len(); |
8198 | while next_grapheme_class!((next_char is SP)) { |
8199 | @@ -286,9 +306,9 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8200 | } |
8201 | |
8202 | CM => { |
8203 | - // LB9 Do not break a combining character sequence; treat it as if it has the line |
8204 | - // breaking class of the base character in all of the following rules. Treat ZWJ as |
8205 | - // if it were CM. |
8206 | + // LB9 Do not break a combining character sequence; treat it as if it has the |
8207 | + // line breaking class of the base character in all of the |
8208 | + // following rules. Treat ZWJ as if it were CM. |
8209 | // Treat X (CM | ZWJ)* as if it were X. |
8210 | // where X is any line break class except BK, CR, LF, NL, SP, or ZW. |
8211 | |
8212 | @@ -296,7 +316,7 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8213 | continue; |
8214 | } |
8215 | WJ => { |
8216 | - /*: LB11 Do not break before or after Word joiner and related characters.*/ |
8217 | + /* : LB11 Do not break before or after Word joiner and related characters. */ |
8218 | *pos += grapheme.len(); |
8219 | /* Get next grapheme */ |
8220 | if next_grapheme_class!(iter, grapheme).is_some() { |
8221 | @@ -305,7 +325,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8222 | continue; |
8223 | } |
8224 | GL => { |
8225 | - /*LB12 Non-breaking characters: LB12 Do not break after NBSP and related characters.*/ |
8226 | + /* LB12 Non-breaking characters: LB12 Do not break after NBSP and related |
8227 | + * characters. */ |
8228 | *pos += grapheme.len(); |
8229 | continue; |
8230 | } |
8231 | @@ -315,8 +336,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8232 | let next_class = get_class!(next_grapheme); |
8233 | match next_class { |
8234 | GL if ![SP, BA, HY].contains(&class) => { |
8235 | - /* LB12a Do not break before NBSP and related characters, except after spaces and |
8236 | - * hyphens. [^SP BA HY] × GL |
8237 | + /* LB12a Do not break before NBSP and related characters, except after |
8238 | + * spaces and hyphens. [^SP BA HY] × GL |
8239 | * Also LB12 Do not break after NBSP and related characters */ |
8240 | *pos += grapheme.len(); |
8241 | continue; |
8242 | @@ -384,8 +405,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8243 | if !text[idx + grapheme.len()..].even_after_spaces().is_empty() |
8244 | && get_class!(text[idx + grapheme.len()..].even_after_spaces()) == NS => |
8245 | { |
8246 | - /* LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with |
8247 | - * intervening spaces. |
8248 | + /* LB16 Do not break between closing punctuation and a nonstarter (lb=NS), |
8249 | + * even with intervening spaces. |
8250 | * (CL | CP) SP* × NS */ |
8251 | *pos += grapheme.len(); |
8252 | while Some(SP) == next_grapheme_class!(iter, grapheme) { |
8253 | @@ -397,7 +418,7 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8254 | && get_class!(text[idx + grapheme.len()..].even_after_spaces()) == B2 => |
8255 | { |
8256 | /* LB17 Do not break within ‘——’, even with intervening spaces. |
8257 | - * B2 SP* × B2*/ |
8258 | + * B2 SP* × B2 */ |
8259 | *pos += grapheme.len(); |
8260 | continue; |
8261 | } |
8262 | @@ -434,8 +455,9 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8263 | set_last_break!(*last_break, ret); |
8264 | return Some((ret, BreakAllowed)); |
8265 | } |
8266 | - /* LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small |
8267 | - * kana, and other non-starters, or after acute accents. × BA, × HY, × NS, BB × */ |
8268 | + /* LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, |
8269 | + * small kana, and other non-starters, or after acute accents. × |
8270 | + * BA, × HY, × NS, BB × */ |
8271 | BB if !*break_now => { |
8272 | *pos += grapheme.len(); |
8273 | continue; |
8274 | @@ -447,8 +469,9 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8275 | let next_class = get_class!(next_grapheme); |
8276 | match next_class { |
8277 | BA | HY | NS => { |
8278 | - /* LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small |
8279 | - * kana, and other non-starters, or after acute accents. × BA, × HY, × NS, BB × */ |
8280 | + /* LB21 Do not break before hyphen-minus, other hyphens, fixed-width |
8281 | + * spaces, small kana, and other non-starters, or |
8282 | + * after acute accents. × BA, × HY, × NS, BB × */ |
8283 | *pos += grapheme.len(); |
8284 | //*pos += next_grapheme.len(); |
8285 | continue; |
8286 | @@ -485,7 +508,7 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8287 | self.iter.next(); |
8288 | continue; |
8289 | } |
8290 | - /* EX × IN */ |
8291 | + /* EX × IN */ |
8292 | EX if next_grapheme_class!((next_char is IN)) => { |
8293 | let (idx, next_grapheme) = next_char.unwrap(); |
8294 | *pos = idx + next_grapheme.len(); |
8295 | @@ -497,21 +520,21 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8296 | *pos += grapheme.len(); |
8297 | continue; |
8298 | } |
8299 | - /* (ID | EB | EM) × IN */ |
8300 | + /* (ID | EB | EM) × IN */ |
8301 | ID | EB | EM if next_grapheme_class!((next_char is IN)) => { |
8302 | let (idx, next_grapheme) = next_char.unwrap(); |
8303 | *pos = idx + next_grapheme.len(); |
8304 | self.iter.next(); |
8305 | continue; |
8306 | } |
8307 | - /* IN × IN */ |
8308 | + /* IN × IN */ |
8309 | IN if next_grapheme_class!((next_char is IN)) => { |
8310 | let (idx, next_grapheme) = next_char.unwrap(); |
8311 | *pos = idx + next_grapheme.len(); |
8312 | self.iter.next(); |
8313 | continue; |
8314 | } |
8315 | - /* NU × IN */ |
8316 | + /* NU × IN */ |
8317 | NU if next_grapheme_class!((next_char is IN)) => { |
8318 | let (idx, next_grapheme) = next_char.unwrap(); |
8319 | *pos = idx + next_grapheme.len(); |
8320 | @@ -533,8 +556,8 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8321 | self.iter.next(); |
8322 | continue; |
8323 | } |
8324 | - /* LB23a Do not break between numeric prefixes and ideographs, or between ideographs |
8325 | - * and numeric postfixes. |
8326 | + /* LB23a Do not break between numeric prefixes and ideographs, or between |
8327 | + * ideographs and numeric postfixes. |
8328 | * PR × (ID | EB | EM) */ |
8329 | PR if next_grapheme_class!((next_char is ID, EB, EM)) => { |
8330 | let (idx, next_grapheme) = next_char.unwrap(); |
8331 | @@ -558,7 +581,7 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8332 | self.iter.next(); |
8333 | continue; |
8334 | } |
8335 | - /*(AL | HL) × (PR | PO) */ |
8336 | + /* (AL | HL) × (PR | PO) */ |
8337 | AL | HL if next_grapheme_class!((next_char is PR, PO)) => { |
8338 | let (idx, next_grapheme) = next_char.unwrap(); |
8339 | *pos = idx + next_grapheme.len(); |
8340 | @@ -749,9 +772,9 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> { |
8341 | continue; |
8342 | } |
8343 | RI => { |
8344 | - /* LB30a Break between two regional indicator symbols if and only if there are an |
8345 | - * even number of regional indicators preceding the position of the break. |
8346 | - * sot (RI RI)* RI × RI |
8347 | + /* LB30a Break between two regional indicator symbols if and only if there |
8348 | + * are an even number of regional indicators preceding |
8349 | + * the position of the break. sot (RI RI)* RI × RI |
8350 | * [^RI] (RI RI)* RI × RI */ |
8351 | *reg_ind_streak += 1; |
8352 | *pos += grapheme.len(); |
8353 | @@ -852,8 +875,7 @@ mod tests { |
8354 | pub use alg::linear; |
8355 | |
8356 | mod alg { |
8357 | - use super::super::grapheme_clusters::TextProcessing; |
8358 | - use super::super::*; |
8359 | + use super::super::{grapheme_clusters::TextProcessing, *}; |
8360 | fn cost(i: usize, j: usize, width: usize, minima: &[usize], offsets: &[usize]) -> usize { |
8361 | let w = offsets[j] + j - offsets[i] - i - 1; |
8362 | if w > width { |
8363 | @@ -1060,7 +1082,7 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option<usize>) -> V |
8364 | } else if prev_quote_depth == quote_depth { |
8365 | /* This becomes part of the paragraph we're in */ |
8366 | } else { |
8367 | - /*Malformed line, different quote depths can't be in the same paragraph. */ |
8368 | + /* Malformed line, different quote depths can't be in the same paragraph. */ |
8369 | let paragraph = &text[paragraph_start..prev_index]; |
8370 | reflow_helper(&mut ret, paragraph, prev_quote_depth, in_paragraph, width); |
8371 | |
8372 | @@ -1071,7 +1093,7 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option<usize>) -> V |
8373 | let paragraph = &text[paragraph_start..*i]; |
8374 | reflow_helper(&mut ret, paragraph, quote_depth, in_paragraph, width); |
8375 | } else { |
8376 | - /*Malformed line, different quote depths can't be in the same paragraph. */ |
8377 | + /* Malformed line, different quote depths can't be in the same paragraph. */ |
8378 | let paragraph = &text[paragraph_start..prev_index]; |
8379 | reflow_helper(&mut ret, paragraph, prev_quote_depth, in_paragraph, width); |
8380 | let paragraph = &text[prev_index..*i]; |
8381 | @@ -1248,12 +1270,13 @@ easy to take MORE than nothing.'"#; |
8382 | } |
8383 | |
8384 | mod segment_tree { |
8385 | - /*! Simple segment tree implementation for maximum in range queries. This is useful if given an |
8386 | - * array of numbers you want to get the maximum value inside an interval quickly. |
8387 | + /*! Simple segment tree implementation for maximum in range queries. This |
8388 | + * is useful if given an array of numbers you want to get the |
8389 | + * maximum value inside an interval quickly. |
8390 | */ |
8391 | + use std::{convert::TryFrom, iter::FromIterator}; |
8392 | + |
8393 | use smallvec::SmallVec; |
8394 | - use std::convert::TryFrom; |
8395 | - use std::iter::FromIterator; |
8396 | |
8397 | #[derive(Default, Debug, Clone)] |
8398 | pub(super) struct SegmentTree { |
8399 | @@ -1329,8 +1352,9 @@ mod segment_tree { |
8400 | } |
8401 | } |
8402 | |
8403 | - /// A lazy stateful iterator for line breaking text. Useful for very long text where you don't want |
8404 | - /// to linebreak it completely before user requests specific lines. |
8405 | + /// A lazy stateful iterator for line breaking text. Useful for very long text |
8406 | + /// where you don't want to linebreak it completely before user requests |
8407 | + /// specific lines. |
8408 | #[derive(Debug, Clone)] |
8409 | pub struct LineBreakText { |
8410 | text: String, |
8411 | @@ -1511,7 +1535,8 @@ impl Iterator for LineBreakText { |
8412 | } else if prev_quote_depth == quote_depth { |
8413 | /* This becomes part of the paragraph we're in */ |
8414 | } else { |
8415 | - /*Malformed line, different quote depths can't be in the same paragraph. */ |
8416 | + /* Malformed line, different quote depths can't be in the same |
8417 | + * paragraph. */ |
8418 | let paragraph_s = &self.text[paragraph_start..prev_index]; |
8419 | reflow_helper2( |
8420 | &mut paragraph, |
8421 | @@ -1534,7 +1559,8 @@ impl Iterator for LineBreakText { |
8422 | self.width, |
8423 | ); |
8424 | } else { |
8425 | - /*Malformed line, different quote depths can't be in the same paragraph. */ |
8426 | + /* Malformed line, different quote depths can't be in the same |
8427 | + * paragraph. */ |
8428 | let paragraph_s = &self.text[paragraph_start..prev_index]; |
8429 | reflow_helper2( |
8430 | &mut paragraph, |
8431 | diff --git a/melib/src/text_processing/search.rs b/melib/src/text_processing/search.rs |
8432 | index 57282e3..29a76c0 100644 |
8433 | --- a/melib/src/text_processing/search.rs |
8434 | +++ b/melib/src/text_processing/search.rs |
8435 | @@ -19,10 +19,10 @@ |
8436 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
8437 | */ |
8438 | |
8439 | - use super::TextProcessing; |
8440 | - |
8441 | use smallvec::SmallVec; |
8442 | |
8443 | + use super::TextProcessing; |
8444 | + |
8445 | pub trait KMP { |
8446 | fn kmp_search(&self, pattern: &str) -> SmallVec<[usize; 256]>; |
8447 | fn kmp_table(graphemes: &[&str]) -> SmallVec<[i32; 256]> { |
8448 | diff --git a/melib/src/text_processing/types.rs b/melib/src/text_processing/types.rs |
8449 | index b088b79..a049558 100644 |
8450 | --- a/melib/src/text_processing/types.rs |
8451 | +++ b/melib/src/text_processing/types.rs |
8452 | @@ -123,15 +123,10 @@ impl From<&str> for LineBreakClass { |
8453 | } |
8454 | } |
8455 | |
8456 | - #[derive(PartialEq, Eq, Debug, Copy, Clone)] |
8457 | + #[derive(PartialEq, Eq, Debug, Copy, Clone, Default)] |
8458 | pub enum Reflow { |
8459 | No, |
8460 | All, |
8461 | + #[default] |
8462 | FormatFlowed, |
8463 | } |
8464 | - |
8465 | - impl Default for Reflow { |
8466 | - fn default() -> Self { |
8467 | - Reflow::FormatFlowed |
8468 | - } |
8469 | - } |
8470 | diff --git a/melib/src/text_processing/wcwidth.rs b/melib/src/text_processing/wcwidth.rs |
8471 | index 3c91f40..cde8686 100644 |
8472 | --- a/melib/src/text_processing/wcwidth.rs |
8473 | +++ b/melib/src/text_processing/wcwidth.rs |
8474 | @@ -48,7 +48,10 @@ pub struct CodePointsIterator<'a> { |
8475 | } |
8476 | |
8477 | /* |
8478 | - * UTF-8 uses a system of binary prefixes, in which the high bits of each byte mark whether it’s a single byte, the beginning of a multi-byte sequence, or a continuation byte; the remaining bits, concatenated, give the code point index. This table shows how it works: |
8479 | + * UTF-8 uses a system of binary prefixes, in which the high bits of each |
8480 | + * byte mark whether it’s a single byte, the beginning of a multi-byte |
8481 | + * sequence, or a continuation byte; the remaining bits, concatenated, give |
8482 | + * the code point index. This table shows how it works: |
8483 | * |
8484 | * UTF-8 (binary) Code point (binary) Range |
8485 | * 0xxxxxxx xxxxxxx U+0000–U+007F |
8486 | diff --git a/melib/src/thread.rs b/melib/src/thread.rs |
8487 | index 76ed82d..2af0356 100644 |
8488 | --- a/melib/src/thread.rs |
8489 | +++ b/melib/src/thread.rs |
8490 | @@ -25,36 +25,38 @@ |
8491 | * This module implements Jamie Zawinski's [threading algorithm](https://www.jwz.org/doc/threading.html). Quoted comments (/* " .. " */) are |
8492 | * taken almost verbatim from the algorithm. |
8493 | * |
8494 | - * The entry point of this module is the `Threads` struct and its `new` method. It contains |
8495 | - * `ThreadNodes` which are the nodes in the thread trees that might have messages associated with |
8496 | - * them. The root nodes (first messages in each thread) are stored in `root_set` and `tree` |
8497 | - * vectors. `Threads` has inner mutability since we need to sort without the user having mutable |
8498 | - * ownership. |
8499 | + * The entry point of this module is the `Threads` struct and its `new` |
8500 | + * method. It contains `ThreadNodes` which are the nodes in the thread trees |
8501 | + * that might have messages associated with them. The root nodes (first |
8502 | + * messages in each thread) are stored in `root_set` and `tree` |
8503 | + * vectors. `Threads` has inner mutability since we need to sort without the |
8504 | + * user having mutable ownership. |
8505 | */ |
8506 | |
8507 | - use crate::datetime::UnixTimestamp; |
8508 | - use crate::email::address::StrBuild; |
8509 | - use crate::email::parser::BytesExt; |
8510 | - use crate::email::*; |
8511 | + use crate::{ |
8512 | + datetime::UnixTimestamp, |
8513 | + email::{address::StrBuild, parser::BytesExt, *}, |
8514 | + }; |
8515 | |
8516 | mod iterators; |
8517 | + use std::{ |
8518 | + cmp::Ordering, |
8519 | + collections::{HashMap, HashSet}, |
8520 | + fmt, |
8521 | + iter::FromIterator, |
8522 | + ops::Index, |
8523 | + result::Result as StdResult, |
8524 | + str::FromStr, |
8525 | + string::ToString, |
8526 | + sync::{Arc, RwLock}, |
8527 | + }; |
8528 | + |
8529 | pub use iterators::*; |
8530 | + use smallvec::SmallVec; |
8531 | + use uuid::Uuid; |
8532 | |
8533 | #[cfg(feature = "unicode_algorithms")] |
8534 | use crate::text_processing::grapheme_clusters::*; |
8535 | - use uuid::Uuid; |
8536 | - |
8537 | - use std::cmp::Ordering; |
8538 | - use std::collections::{HashMap, HashSet}; |
8539 | - use std::fmt; |
8540 | - use std::iter::FromIterator; |
8541 | - use std::ops::Index; |
8542 | - use std::result::Result as StdResult; |
8543 | - use std::str::FromStr; |
8544 | - use std::string::ToString; |
8545 | - use std::sync::{Arc, RwLock}; |
8546 | - |
8547 | - use smallvec::SmallVec; |
8548 | |
8549 | type Envelopes = Arc<RwLock<HashMap<EnvelopeHash, Envelope>>>; |
8550 | |
8551 | @@ -120,24 +122,35 @@ macro_rules! make { |
8552 | let old_group_hash = $threads.find_group($threads.thread_nodes[&$c].group); |
8553 | let parent_group_hash = $threads.find_group($threads.thread_nodes[&$p].group); |
8554 | if old_group_hash != parent_group_hash { |
8555 | - if let Some(old_env_hashes) = $threads.thread_to_envelope.get(&old_group_hash).cloned() { |
8556 | + if let Some(old_env_hashes) = $threads.thread_to_envelope.get(&old_group_hash).cloned() |
8557 | + { |
8558 | for &env_hash in &old_env_hashes { |
8559 | *$threads.envelope_to_thread.entry(env_hash).or_default() = parent_group_hash; |
8560 | } |
8561 | - $threads.thread_to_envelope.entry(parent_group_hash).or_default().extend(old_env_hashes.into_iter()); |
8562 | + $threads |
8563 | + .thread_to_envelope |
8564 | + .entry(parent_group_hash) |
8565 | + .or_default() |
8566 | + .extend(old_env_hashes.into_iter()); |
8567 | } |
8568 | let prev_parent = remove_from_parent!(&mut $threads.thread_nodes, $c); |
8569 | if !($threads.thread_nodes[&$p]).children.contains(&$c) { |
8570 | - /* Pruned nodes keep their children in case they show up in a later merge, so do not panic |
8571 | - * if children exists */ |
8572 | - $threads.thread_nodes.entry($p).and_modify(|e| e.children.push($c)); |
8573 | + /* Pruned nodes keep their children in case they show up in a later merge, so |
8574 | + * do not panic if children exists */ |
8575 | + $threads |
8576 | + .thread_nodes |
8577 | + .entry($p) |
8578 | + .and_modify(|e| e.children.push($c)); |
8579 | } |
8580 | $threads.thread_nodes.entry($c).and_modify(|e| { |
8581 | e.parent = Some($p); |
8582 | }); |
8583 | - let old_group = std::mem::replace($threads.groups.entry(old_group_hash).or_default(), ThreadGroup::Node { |
8584 | - parent: Arc::new(RwLock::new(parent_group_hash)), |
8585 | - }); |
8586 | + let old_group = std::mem::replace( |
8587 | + $threads.groups.entry(old_group_hash).or_default(), |
8588 | + ThreadGroup::Node { |
8589 | + parent: Arc::new(RwLock::new(parent_group_hash)), |
8590 | + }, |
8591 | + ); |
8592 | $threads.thread_nodes.entry($c).and_modify(|e| { |
8593 | e.group = parent_group_hash; |
8594 | }); |
8595 | @@ -147,21 +160,24 @@ macro_rules! make { |
8596 | { |
8597 | let parent_group = $threads.thread_ref_mut(parent_group_hash); |
8598 | match (parent_group, old_group) { |
8599 | - (Thread { |
8600 | - ref mut date, |
8601 | - ref mut len, |
8602 | - ref mut unseen, |
8603 | - ref mut snoozed, |
8604 | - ref mut attachments, |
8605 | - .. |
8606 | - }, ThreadGroup::Root(Thread { |
8607 | - date: old_date, |
8608 | - len: old_len, |
8609 | - unseen: old_unseen, |
8610 | - snoozed: old_snoozed, |
8611 | - attachments: old_attachments, |
8612 | - .. |
8613 | - })) => { |
8614 | + ( |
8615 | + Thread { |
8616 | + ref mut date, |
8617 | + ref mut len, |
8618 | + ref mut unseen, |
8619 | + ref mut snoozed, |
8620 | + ref mut attachments, |
8621 | + .. |
8622 | + }, |
8623 | + ThreadGroup::Root(Thread { |
8624 | + date: old_date, |
8625 | + len: old_len, |
8626 | + unseen: old_unseen, |
8627 | + snoozed: old_snoozed, |
8628 | + attachments: old_attachments, |
8629 | + .. |
8630 | + }), |
8631 | + ) => { |
8632 | *date = std::cmp::max(old_date, *date); |
8633 | *len += old_len; |
8634 | *unseen += old_unseen; |
8635 | @@ -169,13 +185,13 @@ macro_rules! make { |
8636 | *snoozed |= old_snoozed; |
8637 | } |
8638 | _ => unreachable!(), |
8639 | - } |
8640 | + } |
8641 | } |
8642 | prev_parent |
8643 | } else { |
8644 | None |
8645 | } |
8646 | - }}; |
8647 | + }}; |
8648 | } |
8649 | |
8650 | /// Strip common prefixes from subjects |
8651 | @@ -185,9 +201,15 @@ macro_rules! make { |
8652 | /// use melib::thread::SubjectPrefix; |
8653 | /// |
8654 | /// let mut subject = "Re: RE: Res: Re: Res: Subject"; |
8655 | - /// assert_eq!(subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, None), &"Subject"); |
8656 | + /// assert_eq!( |
8657 | + /// subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, None), |
8658 | + /// &"Subject" |
8659 | + /// ); |
8660 | /// let mut subject = "Re: RE: Res: Re: Res: Subject"; |
8661 | - /// assert_eq!(subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, Some(1)), &"RE: Res: Re: Res: Subject"); |
8662 | + /// assert_eq!( |
8663 | + /// subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, Some(1)), |
8664 | + /// &"RE: Res: Re: Res: Subject" |
8665 | + /// ); |
8666 | /// ``` |
8667 | pub trait SubjectPrefix { |
8668 | const USUAL_PREFIXES: &'static [&'static str] = &[ |
8669 | @@ -199,7 +221,7 @@ pub trait SubjectPrefix { |
8670 | "Fw:", |
8671 | /* taken from |
8672 | * https://en.wikipedia.org/wiki/List_of_email_subject_abbreviations#Abbreviations_in_other_languages |
8673 | - * */ |
8674 | + */ |
8675 | "回复:", |
8676 | "回覆:", |
8677 | // Dutch (Antwoord) |
8678 | @@ -919,8 +941,9 @@ impl Threads { |
8679 | .unwrap() |
8680 | .set_thread(thread_hash); |
8681 | |
8682 | - /* If thread node currently has a message from a foreign mailbox and env_hash is |
8683 | - * from current mailbox we want to update it, otherwise return */ |
8684 | + /* If thread node currently has a message from a foreign mailbox and env_hash |
8685 | + * is from current mailbox we want to update it, otherwise |
8686 | + * return */ |
8687 | if node.other_mailbox || other_mailbox { |
8688 | return false; |
8689 | } |
8690 | diff --git a/melib/src/thread/iterators.rs b/melib/src/thread/iterators.rs |
8691 | index 74ded21..99c9d89 100644 |
8692 | --- a/melib/src/thread/iterators.rs |
8693 | +++ b/melib/src/thread/iterators.rs |
8694 | @@ -19,12 +19,14 @@ |
8695 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
8696 | */ |
8697 | |
8698 | - use super::{ThreadNode, ThreadNodeHash}; |
8699 | - use smallvec::SmallVec; |
8700 | use std::collections::HashMap; |
8701 | |
8702 | - /* `ThreadsIterator` returns messages according to the sorted order. For example, for the following |
8703 | - * threads: |
8704 | + use smallvec::SmallVec; |
8705 | + |
8706 | + use super::{ThreadNode, ThreadNodeHash}; |
8707 | + |
8708 | + /* `ThreadsIterator` returns messages according to the sorted order. For |
8709 | + * example, for the following threads: |
8710 | * |
8711 | * ``` |
8712 | * A_ |
8713 | @@ -82,8 +84,8 @@ impl<'a> Iterator for ThreadsGroupIterator<'a> { |
8714 | } |
8715 | } |
8716 | } |
8717 | - /* `ThreadIterator` returns messages of a specific thread according to the sorted order. For example, for the following |
8718 | - * thread: |
8719 | + /* `ThreadIterator` returns messages of a specific thread according to the |
8720 | + * sorted order. For example, for the following thread: |
8721 | * |
8722 | * ``` |
8723 | * A_ |
8724 | diff --git a/rustfmt.toml b/rustfmt.toml |
8725 | index 32a9786..c6f0942 100644 |
8726 | --- a/rustfmt.toml |
8727 | +++ b/rustfmt.toml |
8728 | @@ -1 +1,7 @@ |
8729 | edition = "2018" |
8730 | + format_generated_files = false |
8731 | + format_code_in_doc_comments = true |
8732 | + format_strings = true |
8733 | + imports_granularity = "Crate" |
8734 | + group_imports = "StdExternalCrate" |
8735 | + wrap_comments = true |
8736 | diff --git a/src/args.rs b/src/args.rs |
8737 | index aea88e2..d4c0d34 100644 |
8738 | --- a/src/args.rs |
8739 | +++ b/src/args.rs |
8740 | @@ -67,7 +67,9 @@ pub enum SubCommand { |
8741 | PrintLoadedThemes, |
8742 | /// edit configuration files in `$EDITOR`/`$VISUAL`. |
8743 | EditConfig, |
8744 | - /// create a sample configuration file with available configuration options. If PATH is not specified, meli will try to create it in $XDG_CONFIG_HOME/meli/config.toml |
8745 | + /// create a sample configuration file with available configuration options. |
8746 | + /// If PATH is not specified, meli will try to create it in |
8747 | + /// $XDG_CONFIG_HOME/meli/config.toml |
8748 | #[structopt(display_order = 1)] |
8749 | CreateConfig { |
8750 | #[structopt(value_name = "NEW_CONFIG_PATH", parse(from_os_str))] |
8751 | diff --git a/src/command.rs b/src/command.rs |
8752 | index 562b1a5..22b2490 100644 |
8753 | --- a/src/command.rs |
8754 | +++ b/src/command.rs |
8755 | @@ -20,35 +20,42 @@ |
8756 | */ |
8757 | |
8758 | /*! A parser module for user commands passed through Command mode. |
8759 | - */ |
8760 | - use crate::melib::parser::BytesExt; |
8761 | - use melib::nom::{ |
8762 | - self, |
8763 | - branch::alt, |
8764 | - bytes::complete::{is_a, is_not, tag, take_until}, |
8765 | - character::complete::{digit1, not_line_ending}, |
8766 | - combinator::{map, map_res}, |
8767 | - error::Error as NomError, |
8768 | - multi::separated_list1, |
8769 | - sequence::{pair, preceded, separated_pair}, |
8770 | - IResult, |
8771 | - }; |
8772 | + */ |
8773 | pub use melib::thread::{SortField, SortOrder}; |
8774 | - use melib::Error; |
8775 | + use melib::{ |
8776 | + nom::{ |
8777 | + self, |
8778 | + branch::alt, |
8779 | + bytes::complete::{is_a, is_not, tag, take_until}, |
8780 | + character::complete::{digit1, not_line_ending}, |
8781 | + combinator::{map, map_res}, |
8782 | + error::Error as NomError, |
8783 | + multi::separated_list1, |
8784 | + sequence::{pair, preceded, separated_pair}, |
8785 | + IResult, |
8786 | + }, |
8787 | + Error, |
8788 | + }; |
8789 | + |
8790 | + use crate::melib::parser::BytesExt; |
8791 | pub mod actions; |
8792 | - use actions::MailboxOperation; |
8793 | use std::collections::HashSet; |
8794 | + |
8795 | + use actions::MailboxOperation; |
8796 | pub mod history; |
8797 | - pub use crate::actions::AccountAction::{self, *}; |
8798 | - pub use crate::actions::Action::{self, *}; |
8799 | - pub use crate::actions::ComposeAction::{self, *}; |
8800 | - pub use crate::actions::ListingAction::{self, *}; |
8801 | - pub use crate::actions::MailingListAction::{self, *}; |
8802 | - pub use crate::actions::TabAction::{self, *}; |
8803 | - pub use crate::actions::TagAction::{self, *}; |
8804 | - pub use crate::actions::ViewAction::{self, *}; |
8805 | use std::str::FromStr; |
8806 | |
8807 | + pub use crate::actions::{ |
8808 | + AccountAction::{self, *}, |
8809 | + Action::{self, *}, |
8810 | + ComposeAction::{self, *}, |
8811 | + ListingAction::{self, *}, |
8812 | + MailingListAction::{self, *}, |
8813 | + TabAction::{self, *}, |
8814 | + TagAction::{self, *}, |
8815 | + ViewAction::{self, *}, |
8816 | + }; |
8817 | + |
8818 | /// Helper macro to convert an array of tokens into a TokenStream |
8819 | macro_rules! to_stream { |
8820 | ($token: expr) => { |
8821 | @@ -63,7 +70,8 @@ macro_rules! to_stream { |
8822 | }; |
8823 | } |
8824 | |
8825 | - /// Macro to create a const table with every command part that can be auto-completed and its description |
8826 | + /// Macro to create a const table with every command part that can be |
8827 | + /// auto-completed and its description |
8828 | macro_rules! define_commands { |
8829 | ( [$({ tags: [$( $tags:literal),*], desc: $desc:literal, tokens: $tokens:expr, parser: ($parser:item)}),*]) => { |
8830 | pub const COMMAND_COMPLETION: &[(&str, &str, TokenStream)] = &[$($( ($tags, $desc, TokenStream { tokens: $tokens } ) ),*),* ]; |
8831 | @@ -142,7 +150,8 @@ impl TokenStream { |
8832 | | t @ QuotedStringValue |
8833 | | t @ AlphanumericStringValue => { |
8834 | let _t = t; |
8835 | - //sugg.insert(format!("{}{:?}", if s.is_empty() { " " } else { "" }, t)); |
8836 | + //sugg.insert(format!("{}{:?}", if s.is_empty() { " " } |
8837 | + // else { "" }, t)); |
8838 | } |
8839 | } |
8840 | tokens.push((*s, *t.inner())); |
8841 | @@ -209,7 +218,8 @@ impl TokenStream { |
8842 | } |
8843 | } |
8844 | |
8845 | - /// `Token` wrapper that defines how many times a token is expected to be repeated |
8846 | + /// `Token` wrapper that defines how many times a token is expected to be |
8847 | + /// repeated |
8848 | #[derive(Debug, Copy, Clone)] |
8849 | pub enum TokenAdicity { |
8850 | ZeroOrOne(Token), |
8851 | diff --git a/src/command/actions.rs b/src/command/actions.rs |
8852 | index 7152471..46c8dec 100644 |
8853 | --- a/src/command/actions.rs |
8854 | +++ b/src/command/actions.rs |
8855 | @@ -23,10 +23,12 @@ |
8856 | * User actions that need to be handled by the UI |
8857 | */ |
8858 | |
8859 | - use crate::components::Component; |
8860 | + use std::path::PathBuf; |
8861 | + |
8862 | pub use melib::thread::{SortField, SortOrder}; |
8863 | use melib::uuid::Uuid; |
8864 | - use std::path::PathBuf; |
8865 | + |
8866 | + use crate::components::Component; |
8867 | |
8868 | #[derive(Debug)] |
8869 | pub enum TagAction { |
8870 | diff --git a/src/command/history.rs b/src/command/history.rs |
8871 | index d47d88b..80436c6 100644 |
8872 | --- a/src/command/history.rs |
8873 | +++ b/src/command/history.rs |
8874 | @@ -19,9 +19,11 @@ |
8875 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
8876 | */ |
8877 | |
8878 | - use std::fs::OpenOptions; |
8879 | - use std::io::{Read, Write}; |
8880 | - use std::sync::{Arc, Mutex}; |
8881 | + use std::{ |
8882 | + fs::OpenOptions, |
8883 | + io::{Read, Write}, |
8884 | + sync::{Arc, Mutex}, |
8885 | + }; |
8886 | |
8887 | thread_local!(static CMD_HISTORY_FILE: Arc<Mutex<std::fs::File>> = Arc::new(Mutex::new({ |
8888 | let data_dir = xdg::BaseDirectories::with_prefix("meli").unwrap(); |
8889 | diff --git a/src/components.rs b/src/components.rs |
8890 | index acb3c7b..c7cc544 100644 |
8891 | --- a/src/components.rs |
8892 | +++ b/src/components.rs |
8893 | @@ -21,13 +21,16 @@ |
8894 | |
8895 | /*! Components visual and logical separations of application interfaces. |
8896 | * |
8897 | - * They can draw on the terminal and receive events, but also do other stuff as well. (For example, see the `notifications` module.) |
8898 | + * They can draw on the terminal and receive events, but also do other stuff |
8899 | + * as well. (For example, see the `notifications` module.) |
8900 | * See the `Component` Trait for more details. |
8901 | */ |
8902 | |
8903 | use super::*; |
8904 | - use crate::melib::text_processing::{TextProcessing, Truncate}; |
8905 | - use crate::terminal::boundaries::*; |
8906 | + use crate::{ |
8907 | + melib::text_processing::{TextProcessing, Truncate}, |
8908 | + terminal::boundaries::*, |
8909 | + }; |
8910 | |
8911 | pub mod mail; |
8912 | pub use crate::mail::*; |
8913 | @@ -46,8 +49,10 @@ pub use self::mailbox_management::*; |
8914 | #[cfg(feature = "svgscreenshot")] |
8915 | pub mod svg; |
8916 | |
8917 | - use std::fmt; |
8918 | - use std::fmt::{Debug, Display}; |
8919 | + use std::{ |
8920 | + fmt, |
8921 | + fmt::{Debug, Display}, |
8922 | + }; |
8923 | |
8924 | use indexmap::IndexMap; |
8925 | use uuid::Uuid; |
8926 | @@ -86,8 +91,9 @@ pub enum ScrollUpdate { |
8927 | } |
8928 | |
8929 | /// Types implementing this Trait can draw on the terminal and receive events. |
8930 | - /// If a type wants to skip drawing if it has not changed anything, it can hold some flag in its |
8931 | - /// fields (eg self.dirty = false) and act upon that in their `draw` implementation. |
8932 | + /// If a type wants to skip drawing if it has not changed anything, it can hold |
8933 | + /// some flag in its fields (eg self.dirty = false) and act upon that in their |
8934 | + /// `draw` implementation. |
8935 | pub trait Component: Display + Debug + Send + Sync { |
8936 | fn draw(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context); |
8937 | fn process_event(&mut self, event: &mut UIEvent, context: &mut Context) -> bool; |
8938 | diff --git a/src/components/contacts.rs b/src/components/contacts.rs |
8939 | index e72ab3f..72b4372 100644 |
8940 | --- a/src/components/contacts.rs |
8941 | +++ b/src/components/contacts.rs |
8942 | @@ -19,9 +19,10 @@ |
8943 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
8944 | */ |
8945 | |
8946 | - use super::*; |
8947 | use std::collections::HashMap; |
8948 | |
8949 | + use super::*; |
8950 | + |
8951 | mod contact_list; |
8952 | |
8953 | pub use self::contact_list::*; |
8954 | diff --git a/src/components/contacts/contact_list.rs b/src/components/contacts/contact_list.rs |
8955 | index adf3717..b5ce8e2 100644 |
8956 | --- a/src/components/contacts/contact_list.rs |
8957 | +++ b/src/components/contacts/contact_list.rs |
8958 | @@ -18,12 +18,12 @@ |
8959 | * You should have received a copy of the GNU General Public License |
8960 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
8961 | */ |
8962 | + use std::cmp; |
8963 | + |
8964 | + use melib::{backends::AccountHash, CardId}; |
8965 | + |
8966 | use super::*; |
8967 | use crate::melib::text_processing::TextProcessing; |
8968 | - use melib::backends::AccountHash; |
8969 | - use melib::CardId; |
8970 | - |
8971 | - use std::cmp; |
8972 | |
8973 | #[derive(Debug, PartialEq, Eq)] |
8974 | enum ViewMode { |
8975 | @@ -69,7 +69,7 @@ pub struct ContactList { |
8976 | |
8977 | impl fmt::Display for ContactList { |
8978 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
8979 | - write!(f, "{}", "contact list") |
8980 | + write!(f, "contact list") |
8981 | } |
8982 | } |
8983 | |
8984 | @@ -436,8 +436,8 @@ impl ContactList { |
8985 | ))); |
8986 | } |
8987 | |
8988 | - /* If cursor position has changed, remove the highlight from the previous position and |
8989 | - * apply it in the new one. */ |
8990 | + /* If cursor position has changed, remove the highlight from the previous |
8991 | + * position and apply it in the new one. */ |
8992 | if self.cursor_pos != self.new_cursor_pos && prev_page_no == page_no { |
8993 | let old_cursor_pos = self.cursor_pos; |
8994 | self.cursor_pos = self.new_cursor_pos; |
8995 | @@ -464,7 +464,7 @@ impl ContactList { |
8996 | let width = width!(area); |
8997 | self.data_columns.widths = Default::default(); |
8998 | self.data_columns.widths[0] = self.data_columns.columns[0].size().0; /* name */ |
8999 | - self.data_columns.widths[1] = self.data_columns.columns[1].size().0; /* email*/ |
9000 | + self.data_columns.widths[1] = self.data_columns.columns[1].size().0; /* email */ |
9001 | self.data_columns.widths[2] = self.data_columns.columns[2].size().0; /* url */ |
9002 | self.data_columns.widths[3] = self.data_columns.columns[3].size().0; /* source */ |
9003 | |
9004 | @@ -783,7 +783,7 @@ impl Component for ContactList { |
9005 | .push_back(UIEvent::StatusEvent(StatusEvent::BufClear)); |
9006 | return true; |
9007 | } |
9008 | - UIEvent::Input(Key::Char(c)) if ('0'..='9').contains(&c) => { |
9009 | + UIEvent::Input(Key::Char(c)) if c.is_ascii_digit() => { |
9010 | self.cmd_buf.push(c); |
9011 | context |
9012 | .replies |
9013 | diff --git a/src/components/mail.rs b/src/components/mail.rs |
9014 | index cb9be3d..941f548 100644 |
9015 | --- a/src/components/mail.rs |
9016 | +++ b/src/components/mail.rs |
9017 | @@ -21,10 +21,13 @@ |
9018 | |
9019 | /*! Entities that handle Mail specific functions. |
9020 | */ |
9021 | + use melib::{ |
9022 | + backends::{AccountHash, Mailbox, MailboxHash}, |
9023 | + email::{attachment_types::*, attachments::*}, |
9024 | + thread::ThreadNodeHash, |
9025 | + }; |
9026 | + |
9027 | use super::*; |
9028 | - use melib::backends::{AccountHash, Mailbox, MailboxHash}; |
9029 | - use melib::email::{attachment_types::*, attachments::*}; |
9030 | - use melib::thread::ThreadNodeHash; |
9031 | |
9032 | pub mod listing; |
9033 | pub use crate::listing::*; |
9034 | diff --git a/src/components/mail/compose.rs b/src/components/mail/compose.rs |
9035 | index c6a35ce..a8f91d9 100644 |
9036 | --- a/src/components/mail/compose.rs |
9037 | +++ b/src/components/mail/compose.rs |
9038 | @@ -19,21 +19,23 @@ |
9039 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9040 | */ |
9041 | |
9042 | - use super::*; |
9043 | - use melib::email::attachment_types::{ContentType, MultipartType}; |
9044 | - use melib::list_management; |
9045 | - use melib::Draft; |
9046 | + use std::{ |
9047 | + convert::TryInto, |
9048 | + future::Future, |
9049 | + pin::Pin, |
9050 | + process::{Command, Stdio}, |
9051 | + sync::{Arc, Mutex}, |
9052 | + }; |
9053 | |
9054 | - use crate::conf::accounts::JobRequest; |
9055 | - use crate::jobs::JoinHandle; |
9056 | - use crate::terminal::embed::EmbedTerminal; |
9057 | use indexmap::IndexSet; |
9058 | + use melib::{ |
9059 | + email::attachment_types::{ContentType, MultipartType}, |
9060 | + list_management, Draft, |
9061 | + }; |
9062 | use nix::sys::wait::WaitStatus; |
9063 | - use std::convert::TryInto; |
9064 | - use std::future::Future; |
9065 | - use std::pin::Pin; |
9066 | - use std::process::{Command, Stdio}; |
9067 | - use std::sync::{Arc, Mutex}; |
9068 | + |
9069 | + use super::*; |
9070 | + use crate::{conf::accounts::JobRequest, jobs::JoinHandle, terminal::embed::EmbedTerminal}; |
9071 | |
9072 | #[cfg(feature = "gpgme")] |
9073 | mod gpg; |
9074 | @@ -373,8 +375,9 @@ impl Composer { |
9075 | let mut ret = Composer::reply_to(coordinates, reply_body, context, false); |
9076 | let account = &context.accounts[&coordinates.0]; |
9077 | let parent_message = account.collection.get_env(coordinates.2); |
9078 | - /* If message is from a mailing list and we detect a List-Post header, ask user if they |
9079 | - * want to reply to the mailing list or the submitter of the message */ |
9080 | + /* If message is from a mailing list and we detect a List-Post header, ask |
9081 | + * user if they want to reply to the mailing list or the submitter of |
9082 | + * the message */ |
9083 | if let Some(actions) = list_management::ListActions::detect(&parent_message) { |
9084 | if let Some(post) = actions.post { |
9085 | if let list_management::ListAction::Email(list_post_addr) = post[0] { |
9086 | @@ -1104,20 +1107,27 @@ impl Component for Composer { |
9087 | ))); |
9088 | self.mode = ViewMode::WaitingForSendResult( |
9089 | UIDialog::new( |
9090 | - "Waiting for confirmation.. The tab will close automatically on successful submission.", |
9091 | + "Waiting for confirmation.. The tab will close automatically \ |
9092 | + on successful submission.", |
9093 | vec![ |
9094 | - ('c', "force close tab".to_string()), |
9095 | - ('n', "close this message and return to edit mode".to_string()), |
9096 | + ('c', "force close tab".to_string()), |
9097 | + ( |
9098 | + 'n', |
9099 | + "close this message and return to edit mode" |
9100 | + .to_string(), |
9101 | + ), |
9102 | ], |
9103 | true, |
9104 | Some(Box::new(move |id: ComponentId, results: &[char]| { |
9105 | Some(UIEvent::FinishedUIDialog( |
9106 | - id, |
9107 | - Box::new(results.first().cloned().unwrap_or('c')), |
9108 | + id, |
9109 | + Box::new(results.first().cloned().unwrap_or('c')), |
9110 | )) |
9111 | })), |
9112 | context, |
9113 | - ), handle); |
9114 | + ), |
9115 | + handle, |
9116 | + ); |
9117 | } |
9118 | Err(err) => { |
9119 | context.replies.push_back(UIEvent::Notification( |
9120 | @@ -1680,10 +1690,12 @@ impl Component for Composer { |
9121 | match std::env::var("EDITOR") { |
9122 | Err(err) => { |
9123 | context.replies.push_back(UIEvent::Notification( |
9124 | - Some(err.to_string()), |
9125 | - "$EDITOR is not set. You can change an envvar's value with setenv or set composing.editor_command setting in your configuration.".to_string(), |
9126 | - Some(NotificationType::Error(melib::error::ErrorKind::None)), |
9127 | - )); |
9128 | + Some(err.to_string()), |
9129 | + "$EDITOR is not set. You can change an envvar's value with setenv \ |
9130 | + or set composing.editor_command setting in your configuration." |
9131 | + .to_string(), |
9132 | + Some(NotificationType::Error(melib::error::ErrorKind::None)), |
9133 | + )); |
9134 | return true; |
9135 | } |
9136 | Ok(v) => v, |
9137 | @@ -1744,7 +1756,7 @@ impl Component for Composer { |
9138 | DEBUG, |
9139 | ); |
9140 | match Command::new("sh") |
9141 | - .args(&["-c", &editor_command]) |
9142 | + .args(["-c", &editor_command]) |
9143 | .stdin(Stdio::inherit()) |
9144 | .stdout(Stdio::inherit()) |
9145 | .spawn() |
9146 | @@ -1798,7 +1810,7 @@ impl Component for Composer { |
9147 | } |
9148 | let f = create_temp_file(&[], None, None, true); |
9149 | match Command::new("sh") |
9150 | - .args(&["-c", command]) |
9151 | + .args(["-c", command]) |
9152 | .stdin(Stdio::null()) |
9153 | .stdout(Stdio::from(f.file())) |
9154 | .spawn() |
9155 | @@ -1886,7 +1898,7 @@ impl Component for Composer { |
9156 | DEBUG, |
9157 | ); |
9158 | match Command::new("sh") |
9159 | - .args(&["-c", command]) |
9160 | + .args(["-c", command]) |
9161 | .stdin(Stdio::inherit()) |
9162 | .stdout(Stdio::inherit()) |
9163 | .stderr(Stdio::piped()) |
9164 | diff --git a/src/components/mail/compose/edit_attachments.rs b/src/components/mail/compose/edit_attachments.rs |
9165 | index 9e1a61a..baa9d44 100644 |
9166 | --- a/src/components/mail/compose/edit_attachments.rs |
9167 | +++ b/src/components/mail/compose/edit_attachments.rs |
9168 | @@ -21,18 +21,13 @@ |
9169 | |
9170 | use super::*; |
9171 | |
9172 | - #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
9173 | + #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] |
9174 | pub enum EditAttachmentCursor { |
9175 | AttachmentNo(usize), |
9176 | + #[default] |
9177 | Buttons, |
9178 | } |
9179 | |
9180 | - impl Default for EditAttachmentCursor { |
9181 | - fn default() -> Self { |
9182 | - EditAttachmentCursor::Buttons |
9183 | - } |
9184 | - } |
9185 | - |
9186 | #[derive(Debug)] |
9187 | pub enum EditAttachmentMode { |
9188 | Overview, |
9189 | diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs |
9190 | index 5a0e9d0..c99fef2 100644 |
9191 | --- a/src/components/mail/listing.rs |
9192 | +++ b/src/components/mail/listing.rs |
9193 | @@ -19,27 +19,32 @@ |
9194 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9195 | */ |
9196 | |
9197 | - use super::*; |
9198 | - use crate::conf::accounts::JobRequest; |
9199 | - use crate::types::segment_tree::SegmentTree; |
9200 | + use std::{ |
9201 | + collections::{BTreeSet, HashMap, HashSet}, |
9202 | + convert::TryFrom, |
9203 | + ops::{Deref, DerefMut}, |
9204 | + }; |
9205 | + |
9206 | use melib::backends::EnvelopeHashBatch; |
9207 | use smallvec::SmallVec; |
9208 | - use std::collections::{BTreeSet, HashMap, HashSet}; |
9209 | - use std::convert::TryFrom; |
9210 | - use std::ops::{Deref, DerefMut}; |
9211 | |
9212 | - // TODO: emoji_text_presentation_selector should be printed along with the chars before it but not |
9213 | - // as a separate Cell |
9214 | + use super::*; |
9215 | + use crate::{conf::accounts::JobRequest, types::segment_tree::SegmentTree}; |
9216 | + |
9217 | + // TODO: emoji_text_presentation_selector should be printed along with the chars |
9218 | + // before it but not as a separate Cell |
9219 | //macro_rules! emoji_text_presentation_selector { |
9220 | // () => { |
9221 | // "\u{FE0E}" |
9222 | // }; |
9223 | //} |
9224 | // |
9225 | - //pub const DEFAULT_ATTACHMENT_FLAG: &str = concat!("📎", emoji_text_presentation_selector!()); |
9226 | - //pub const DEFAULT_SELECTED_FLAG: &str = concat!("☑️", emoji_text_presentation_selector!()); |
9227 | - //pub const DEFAULT_UNSEEN_FLAG: &str = concat!("●", emoji_text_presentation_selector!()); |
9228 | - //pub const DEFAULT_SNOOZED_FLAG: &str = concat!("💤", emoji_text_presentation_selector!()); |
9229 | + //pub const DEFAULT_ATTACHMENT_FLAG: &str = concat!("📎", |
9230 | + // emoji_text_presentation_selector!()); pub const DEFAULT_SELECTED_FLAG: &str = |
9231 | + // concat!("☑️", emoji_text_presentation_selector!()); |
9232 | + // pub const DEFAULT_UNSEEN_FLAG: &str = concat!("●", |
9233 | + // emoji_text_presentation_selector!()); pub const DEFAULT_SNOOZED_FLAG: &str = |
9234 | + // concat!("💤", emoji_text_presentation_selector!()); |
9235 | |
9236 | pub const DEFAULT_ATTACHMENT_FLAG: &str = "📎"; |
9237 | pub const DEFAULT_SELECTED_FLAG: &str = "☑️"; |
9238 | @@ -225,20 +230,15 @@ pub enum Focus { |
9239 | EntryFullscreen, |
9240 | } |
9241 | |
9242 | - #[derive(Debug, Copy, PartialEq, Eq, Clone)] |
9243 | + #[derive(Debug, Copy, PartialEq, Eq, Clone, Default)] |
9244 | pub enum Modifier { |
9245 | + #[default] |
9246 | SymmetricDifference, |
9247 | Union, |
9248 | Difference, |
9249 | Intersection, |
9250 | } |
9251 | |
9252 | - impl Default for Modifier { |
9253 | - fn default() -> Self { |
9254 | - Modifier::SymmetricDifference |
9255 | - } |
9256 | - } |
9257 | - |
9258 | #[derive(Debug, Default)] |
9259 | /// Save theme colors to avoid looking them up again and again from settings |
9260 | pub struct ColorCache { |
9261 | @@ -601,10 +601,9 @@ pub trait MailListingTrait: ListingTrait { |
9262 | } |
9263 | } |
9264 | ListingAction::ExportMbox(format, ref path) => { |
9265 | + use std::{future::Future, io::Write, pin::Pin}; |
9266 | + |
9267 | use futures::future::try_join_all; |
9268 | - use std::future::Future; |
9269 | - use std::io::Write; |
9270 | - use std::pin::Pin; |
9271 | |
9272 | let futures: Result<Vec<_>> = envs_to_set |
9273 | .iter() |
9274 | @@ -725,7 +724,8 @@ pub trait MailListingTrait: ListingTrait { |
9275 | ) { |
9276 | } |
9277 | |
9278 | - /// Use `force` when there have been changes in the mailbox or account lists in `context` |
9279 | + /// Use `force` when there have been changes in the mailbox or account lists |
9280 | + /// in `context` |
9281 | fn refresh_mailbox(&mut self, context: &mut Context, force: bool); |
9282 | } |
9283 | |
9284 | @@ -1357,7 +1357,7 @@ impl Component for Listing { |
9285 | .mailbox_by_path(mailbox_path) |
9286 | .and_then(|mailbox_hash| { |
9287 | Ok(( |
9288 | - std::fs::read(&file_path).chain_err_summary(|| { |
9289 | + std::fs::read(file_path).chain_err_summary(|| { |
9290 | format!("Could not read {}", file_path.display()) |
9291 | })?, |
9292 | mailbox_hash, |
9293 | @@ -1716,7 +1716,8 @@ impl Component for Listing { |
9294 | *account_cursor += 1; |
9295 | *entry_cursor = MenuEntryCursor::Status; |
9296 | } |
9297 | - /* If current account has no mailboxes and there is no next account, return true */ |
9298 | + /* If current account has no mailboxes and there is no next |
9299 | + * account, return true */ |
9300 | (_, MenuEntryCursor::Status) => { |
9301 | return true; |
9302 | } |
9303 | @@ -1929,7 +1930,7 @@ impl Component for Listing { |
9304 | .push_back(UIEvent::StatusEvent(StatusEvent::BufClear)); |
9305 | return true; |
9306 | } |
9307 | - UIEvent::Input(Key::Char(c)) if ('0'..='9').contains(&c) => { |
9308 | + UIEvent::Input(Key::Char(c)) if c.is_ascii_digit() => { |
9309 | self.cmd_buf.push(c); |
9310 | self.component.set_modifier_active(true); |
9311 | context |
9312 | @@ -2309,8 +2310,8 @@ impl Listing { |
9313 | let mut branches = String::with_capacity(16); |
9314 | |
9315 | // What depth to skip if a mailbox is toggled to collapse |
9316 | - // The value should be the collapsed mailbox's indentation, so that its children are not |
9317 | - // visible. |
9318 | + // The value should be the collapsed mailbox's indentation, so that its children |
9319 | + // are not visible. |
9320 | let mut skip: Option<usize> = None; |
9321 | let mut skipped_counter: usize = 0; |
9322 | 'grid_loop: for y in get_y(upper_left) + 1..get_y(bottom_right) { |
9323 | @@ -2381,8 +2382,8 @@ impl Listing { |
9324 | ) |
9325 | }; |
9326 | |
9327 | - /* Calculate how many columns the mailbox index tags should occupy with right alignment, |
9328 | - * eg. |
9329 | + /* Calculate how many columns the mailbox index tags should occupy with right |
9330 | + * alignment, eg. |
9331 | * 1 |
9332 | * 2 |
9333 | * ... |
9334 | diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs |
9335 | index ed90dd2..0466c41 100644 |
9336 | --- a/src/components/mail/listing/compact.rs |
9337 | +++ b/src/components/mail/listing/compact.rs |
9338 | @@ -19,14 +19,12 @@ |
9339 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9340 | */ |
9341 | |
9342 | - use super::*; |
9343 | - use crate::components::PageMovement; |
9344 | - use crate::jobs::JoinHandle; |
9345 | + use std::{cmp, collections::BTreeMap, convert::TryInto, iter::FromIterator}; |
9346 | + |
9347 | use indexmap::IndexSet; |
9348 | - use std::cmp; |
9349 | - use std::collections::BTreeMap; |
9350 | - use std::convert::TryInto; |
9351 | - use std::iter::FromIterator; |
9352 | + |
9353 | + use super::*; |
9354 | + use crate::{components::PageMovement, jobs::JoinHandle}; |
9355 | |
9356 | macro_rules! digits_of_num { |
9357 | ($num:expr) => {{ |
9358 | @@ -158,8 +156,8 @@ macro_rules! row_attr { |
9359 | }}; |
9360 | } |
9361 | |
9362 | - /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the `Envelope` content in a |
9363 | - /// `ThreadView`. |
9364 | + /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the |
9365 | + /// `Envelope` content in a `ThreadView`. |
9366 | #[derive(Debug)] |
9367 | pub struct CompactListing { |
9368 | /// (x, y, z): x is accounts, y is mailboxes, z is index inside a mailbox. |
9369 | @@ -239,8 +237,8 @@ impl MailListingTrait for CompactListing { |
9370 | SmallVec::from_iter(iter) |
9371 | } |
9372 | |
9373 | - /// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has |
9374 | - /// chosen. |
9375 | + /// Fill the `self.data_columns` `CellBuffers` with the contents of the |
9376 | + /// account mailbox the user has chosen. |
9377 | fn refresh_mailbox(&mut self, context: &mut Context, force: bool) { |
9378 | self.set_dirty(true); |
9379 | self.rows.clear(); |
9380 | @@ -565,7 +563,7 @@ impl ListingTrait for CompactListing { |
9381 | fn set_coordinates(&mut self, coordinates: (AccountHash, MailboxHash)) { |
9382 | self.new_cursor_pos = (coordinates.0, coordinates.1, 0); |
9383 | self.focus = Focus::None; |
9384 | - self.view = Box::new(ThreadView::default()); |
9385 | + self.view = Box::<ThreadView>::default(); |
9386 | self.filtered_selection.clear(); |
9387 | self.filtered_order.clear(); |
9388 | self.filter_term.clear(); |
9389 | @@ -692,8 +690,8 @@ impl ListingTrait for CompactListing { |
9390 | let end_idx = cmp::min(self.length.saturating_sub(1), top_idx + rows - 1); |
9391 | self.draw_rows(context, top_idx, end_idx); |
9392 | |
9393 | - /* If cursor position has changed, remove the highlight from the previous position and |
9394 | - * apply it in the new one. */ |
9395 | + /* If cursor position has changed, remove the highlight from the previous |
9396 | + * position and apply it in the new one. */ |
9397 | if self.cursor_pos.2 != self.new_cursor_pos.2 && prev_page_no == page_no { |
9398 | let old_cursor_pos = self.cursor_pos; |
9399 | self.cursor_pos = self.new_cursor_pos; |
9400 | @@ -840,9 +838,10 @@ impl ListingTrait for CompactListing { |
9401 | self.view |
9402 | .process_event(&mut UIEvent::VisibilityChange(false), context); |
9403 | self.dirty = true; |
9404 | - /* If self.rows.row_updates is not empty and we exit a thread, the row_update events |
9405 | - * will be performed but the list will not be drawn. So force a draw in any case. |
9406 | - * */ |
9407 | + /* If self.rows.row_updates is not empty and we exit a thread, the row_update |
9408 | + * events will be performed but the list will not be drawn. |
9409 | + * So force a draw in any case. |
9410 | + */ |
9411 | self.force_draw = true; |
9412 | } |
9413 | Focus::Entry => { |
9414 | @@ -889,7 +888,7 @@ impl CompactListing { |
9415 | rows: RowsState::default(), |
9416 | dirty: true, |
9417 | force_draw: true, |
9418 | - view: Box::new(ThreadView::default()), |
9419 | + view: Box::<ThreadView>::default(), |
9420 | color_cache: ColorCache::default(), |
9421 | movement: None, |
9422 | modifier_active: false, |
9423 | @@ -1064,8 +1063,8 @@ impl CompactListing { |
9424 | let account = &context.accounts[&self.cursor_pos.0]; |
9425 | |
9426 | if !account.contains_key(env_hash) { |
9427 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
9428 | - * arrive */ |
9429 | + /* The envelope has been renamed or removed, so wait for the appropriate |
9430 | + * event to arrive */ |
9431 | return; |
9432 | } |
9433 | let tags_lck = account.collection.tag_index.read().unwrap(); |
9434 | diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs |
9435 | index bee3012..d9751d6 100644 |
9436 | --- a/src/components/mail/listing/conversations.rs |
9437 | +++ b/src/components/mail/listing/conversations.rs |
9438 | @@ -19,12 +19,12 @@ |
9439 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9440 | */ |
9441 | |
9442 | - use super::*; |
9443 | - use crate::components::PageMovement; |
9444 | - use crate::jobs::JoinHandle; |
9445 | + use std::{collections::BTreeMap, iter::FromIterator}; |
9446 | + |
9447 | use indexmap::IndexSet; |
9448 | - use std::collections::BTreeMap; |
9449 | - use std::iter::FromIterator; |
9450 | + |
9451 | + use super::*; |
9452 | + use crate::{components::PageMovement, jobs::JoinHandle}; |
9453 | |
9454 | macro_rules! row_attr { |
9455 | ($field:ident, $color_cache:expr, $unseen:expr, $highlighted:expr, $selected:expr $(,)*) => {{ |
9456 | @@ -91,8 +91,8 @@ macro_rules! row_attr { |
9457 | }}; |
9458 | } |
9459 | |
9460 | - /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the `Envelope` content in a |
9461 | - /// `ThreadView`. |
9462 | + /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the |
9463 | + /// `Envelope` content in a `ThreadView`. |
9464 | #[derive(Debug)] |
9465 | pub struct ConversationsListing { |
9466 | /// (x, y, z): x is accounts, y is mailboxes, z is index inside a mailbox. |
9467 | @@ -455,8 +455,8 @@ impl ListingTrait for ConversationsListing { |
9468 | |
9469 | let top_idx = page_no * rows; |
9470 | |
9471 | - /* If cursor position has changed, remove the highlight from the previous position and |
9472 | - * apply it in the new one. */ |
9473 | + /* If cursor position has changed, remove the highlight from the previous |
9474 | + * position and apply it in the new one. */ |
9475 | if self.cursor_pos.2 != self.new_cursor_pos.2 && prev_page_no == page_no { |
9476 | let old_cursor_pos = self.cursor_pos; |
9477 | self.cursor_pos = self.new_cursor_pos; |
9478 | @@ -582,9 +582,10 @@ impl ListingTrait for ConversationsListing { |
9479 | self.view |
9480 | .process_event(&mut UIEvent::VisibilityChange(false), context); |
9481 | self.dirty = true; |
9482 | - /* If self.rows.row_updates is not empty and we exit a thread, the row_update events |
9483 | - * will be performed but the list will not be drawn. So force a draw in any case. |
9484 | - * */ |
9485 | + /* If self.rows.row_updates is not empty and we exit a thread, the row_update |
9486 | + * events will be performed but the list will not be drawn. |
9487 | + * So force a draw in any case. |
9488 | + */ |
9489 | self.force_draw = true; |
9490 | } |
9491 | Focus::Entry => { |
9492 | @@ -1181,7 +1182,7 @@ impl Component for ConversationsListing { |
9493 | |
9494 | if !self.rows.row_updates.is_empty() { |
9495 | /* certain rows need to be updated (eg an unseen message was just set seen) |
9496 | - * */ |
9497 | + */ |
9498 | while let Some(row) = self.rows.row_updates.pop() { |
9499 | self.update_line(context, row); |
9500 | let row: usize = self.rows.env_order[&row]; |
9501 | @@ -1379,7 +1380,8 @@ impl Component for ConversationsListing { |
9502 | // FIXME subsort |
9503 | //if !self.filtered_selection.is_empty() { |
9504 | // let threads = &account.collection.threads[&self.cursor_pos.1]; |
9505 | - // threads.vec_inner_sort_by(&mut self.filtered_selection, self.sort, &account.collection); |
9506 | + // threads.vec_inner_sort_by(&mut self.filtered_selection, self.sort, |
9507 | + // &account.collection); |
9508 | //} else { |
9509 | // self.refresh_mailbox(context, false); |
9510 | //} |
9511 | diff --git a/src/components/mail/listing/offline.rs b/src/components/mail/listing/offline.rs |
9512 | index 3fdcebe..aa4a83e 100644 |
9513 | --- a/src/components/mail/listing/offline.rs |
9514 | +++ b/src/components/mail/listing/offline.rs |
9515 | @@ -19,9 +19,10 @@ |
9516 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9517 | */ |
9518 | |
9519 | + use std::borrow::Cow; |
9520 | + |
9521 | use super::*; |
9522 | use crate::components::PageMovement; |
9523 | - use std::borrow::Cow; |
9524 | |
9525 | #[derive(Debug)] |
9526 | pub struct OfflineListing { |
9527 | diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs |
9528 | index 94e692d..d7af0c3 100644 |
9529 | --- a/src/components/mail/listing/plain.rs |
9530 | +++ b/src/components/mail/listing/plain.rs |
9531 | @@ -19,12 +19,10 @@ |
9532 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9533 | */ |
9534 | |
9535 | - use super::EntryStrings; |
9536 | - use super::*; |
9537 | - use crate::components::PageMovement; |
9538 | - use crate::jobs::JoinHandle; |
9539 | - use std::cmp; |
9540 | - use std::iter::FromIterator; |
9541 | + use std::{cmp, iter::FromIterator}; |
9542 | + |
9543 | + use super::{EntryStrings, *}; |
9544 | + use crate::{components::PageMovement, jobs::JoinHandle}; |
9545 | |
9546 | macro_rules! address_list { |
9547 | (($name:expr) as comma_sep_list) => {{ |
9548 | @@ -118,8 +116,8 @@ macro_rules! row_attr { |
9549 | }}; |
9550 | } |
9551 | |
9552 | - /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the `Envelope` content in a |
9553 | - /// `MailView`. |
9554 | + /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the |
9555 | + /// `Envelope` content in a `MailView`. |
9556 | #[derive(Debug)] |
9557 | pub struct PlainListing { |
9558 | /// (x, y, z): x is accounts, y is mailboxes, z is index inside a mailbox. |
9559 | @@ -182,8 +180,8 @@ impl MailListingTrait for PlainListing { |
9560 | ) |
9561 | } |
9562 | |
9563 | - /// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has |
9564 | - /// chosen. |
9565 | + /// Fill the `self.data_columns` `CellBuffers` with the contents of the |
9566 | + /// account mailbox the user has chosen. |
9567 | fn refresh_mailbox(&mut self, context: &mut Context, force: bool) { |
9568 | self.set_dirty(true); |
9569 | let old_cursor_pos = self.cursor_pos; |
9570 | @@ -423,8 +421,8 @@ impl ListingTrait for PlainListing { |
9571 | |
9572 | let top_idx = page_no * rows; |
9573 | |
9574 | - /* If cursor position has changed, remove the highlight from the previous position and |
9575 | - * apply it in the new one. */ |
9576 | + /* If cursor position has changed, remove the highlight from the previous |
9577 | + * position and apply it in the new one. */ |
9578 | if self.cursor_pos.2 != self.new_cursor_pos.2 && prev_page_no == page_no { |
9579 | let old_cursor_pos = self.cursor_pos; |
9580 | self.cursor_pos = self.new_cursor_pos; |
9581 | @@ -571,9 +569,10 @@ impl ListingTrait for PlainListing { |
9582 | self.view |
9583 | .process_event(&mut UIEvent::VisibilityChange(false), context); |
9584 | self.dirty = true; |
9585 | - /* If self.rows.row_updates is not empty and we exit a thread, the row_update events |
9586 | - * will be performed but the list will not be drawn. So force a draw in any case. |
9587 | - * */ |
9588 | + /* If self.rows.row_updates is not empty and we exit a thread, the row_update |
9589 | + * events will be performed but the list will not be drawn. |
9590 | + * So force a draw in any case. |
9591 | + */ |
9592 | self.force_draw = true; |
9593 | } |
9594 | Focus::Entry => { |
9595 | @@ -973,8 +972,8 @@ impl PlainListing { |
9596 | let account = &context.accounts[&self.cursor_pos.0]; |
9597 | |
9598 | if !account.contains_key(env_hash) { |
9599 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
9600 | - * arrive */ |
9601 | + /* The envelope has been renamed or removed, so wait for the appropriate |
9602 | + * event to arrive */ |
9603 | return; |
9604 | } |
9605 | let envelope: EnvelopeRef = account.collection.get_env(env_hash); |
9606 | @@ -1425,7 +1424,8 @@ impl Component for PlainListing { |
9607 | self.subsort = (*field, *order); |
9608 | //if !self.filtered_selection.is_empty() { |
9609 | // let threads = &account.collection.threads[&self.cursor_pos.1]; |
9610 | - // threads.vec_inner_sort_by(&mut self.filtered_selection, self.sort, &account.collection); |
9611 | + // threads.vec_inner_sort_by(&mut self.filtered_selection, self.sort, |
9612 | + // &account.collection); |
9613 | //} else { |
9614 | // self.refresh_mailbox(contex, falset); |
9615 | //} |
9616 | diff --git a/src/components/mail/listing/thread.rs b/src/components/mail/listing/thread.rs |
9617 | index 765be9c..ed0398f 100644 |
9618 | --- a/src/components/mail/listing/thread.rs |
9619 | +++ b/src/components/mail/listing/thread.rs |
9620 | @@ -19,12 +19,10 @@ |
9621 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9622 | */ |
9623 | |
9624 | + use std::{cmp, convert::TryInto, fmt::Write, iter::FromIterator}; |
9625 | + |
9626 | use super::*; |
9627 | use crate::components::PageMovement; |
9628 | - use std::cmp; |
9629 | - use std::convert::TryInto; |
9630 | - use std::fmt::Write; |
9631 | - use std::iter::FromIterator; |
9632 | |
9633 | macro_rules! row_attr { |
9634 | ($color_cache:expr, $even: expr, $unseen:expr, $highlighted:expr, $selected:expr $(,)*) => {{ |
9635 | @@ -102,8 +100,8 @@ macro_rules! row_attr { |
9636 | }}; |
9637 | } |
9638 | |
9639 | - /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the `Envelope` content in a |
9640 | - /// `MailView`. |
9641 | + /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the |
9642 | + /// `Envelope` content in a `MailView`. |
9643 | #[derive(Debug)] |
9644 | pub struct ThreadListing { |
9645 | /// (x, y, z): x is accounts, y is mailboxes, z is index inside a mailbox. |
9646 | @@ -167,8 +165,8 @@ impl MailListingTrait for ThreadListing { |
9647 | ) |
9648 | } |
9649 | |
9650 | - /// Fill the `self.content` `CellBuffer` with the contents of the account mailbox the user has |
9651 | - /// chosen. |
9652 | + /// Fill the `self.content` `CellBuffer` with the contents of the account |
9653 | + /// mailbox the user has chosen. |
9654 | fn refresh_mailbox(&mut self, context: &mut Context, _force: bool) { |
9655 | self.set_dirty(true); |
9656 | if !(self.cursor_pos.0 == self.new_cursor_pos.0 |
9657 | @@ -485,8 +483,8 @@ impl ListingTrait for ThreadListing { |
9658 | |
9659 | let top_idx = page_no * rows; |
9660 | |
9661 | - /* If cursor position has changed, remove the highlight from the previous position and |
9662 | - * apply it in the new one. */ |
9663 | + /* If cursor position has changed, remove the highlight from the previous |
9664 | + * position and apply it in the new one. */ |
9665 | if self.cursor_pos.2 != self.new_cursor_pos.2 && prev_page_no == page_no { |
9666 | let old_cursor_pos = self.cursor_pos; |
9667 | self.cursor_pos = self.new_cursor_pos; |
9668 | @@ -634,9 +632,10 @@ impl ListingTrait for ThreadListing { |
9669 | Focus::None => { |
9670 | self.view = None; |
9671 | self.dirty = true; |
9672 | - /* If self.rows.row_updates is not empty and we exit a thread, the row_update events |
9673 | - * will be performed but the list will not be drawn. So force a draw in any case. |
9674 | - * */ |
9675 | + /* If self.rows.row_updates is not empty and we exit a thread, the row_update |
9676 | + * events will be performed but the list will not be drawn. |
9677 | + * So force a draw in any case. |
9678 | + */ |
9679 | self.force_draw = true; |
9680 | } |
9681 | Focus::Entry => { |
9682 | @@ -982,8 +981,8 @@ impl ThreadListing { |
9683 | let account = &context.accounts[&self.cursor_pos.0]; |
9684 | |
9685 | if !account.contains_key(env_hash) { |
9686 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
9687 | - * arrive */ |
9688 | + /* The envelope has been renamed or removed, so wait for the appropriate |
9689 | + * event to arrive */ |
9690 | return; |
9691 | } |
9692 | let envelope: EnvelopeRef = account.collection.get_env(env_hash); |
9693 | diff --git a/src/components/mail/pgp.rs b/src/components/mail/pgp.rs |
9694 | index 06a11d5..8951600 100644 |
9695 | --- a/src/components/mail/pgp.rs |
9696 | +++ b/src/components/mail/pgp.rs |
9697 | @@ -22,15 +22,17 @@ |
9698 | //FIXME |
9699 | #![allow(unused_imports, unused_variables)] |
9700 | |
9701 | - use melib::email::{ |
9702 | - attachment_types::{ContentDisposition, ContentType, MultipartType}, |
9703 | - pgp as melib_pgp, Attachment, AttachmentBuilder, |
9704 | + use std::{future::Future, pin::Pin}; |
9705 | + |
9706 | + use melib::{ |
9707 | + email::{ |
9708 | + attachment_types::{ContentDisposition, ContentType, MultipartType}, |
9709 | + pgp as melib_pgp, Attachment, AttachmentBuilder, |
9710 | + }, |
9711 | + error::*, |
9712 | + gpgme::*, |
9713 | + parser::BytesExt, |
9714 | }; |
9715 | - use melib::error::*; |
9716 | - use melib::gpgme::*; |
9717 | - use melib::parser::BytesExt; |
9718 | - use std::future::Future; |
9719 | - use std::pin::Pin; |
9720 | |
9721 | pub async fn decrypt(raw: Vec<u8>) -> Result<(melib_pgp::DecryptionMetadata, Vec<u8>)> { |
9722 | Err("libgpgme functions are temporarily disabled due to an unsolved bug <https://git.meli.delivery/meli/meli/issues/176>.".into()) |
9723 | diff --git a/src/components/mail/status.rs b/src/components/mail/status.rs |
9724 | index 4748e92..b93e93a 100644 |
9725 | --- a/src/components/mail/status.rs |
9726 | +++ b/src/components/mail/status.rs |
9727 | @@ -33,7 +33,7 @@ pub struct AccountStatus { |
9728 | |
9729 | impl fmt::Display for AccountStatus { |
9730 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
9731 | - write!(f, "{}", "status") |
9732 | + write!(f, "status") |
9733 | } |
9734 | } |
9735 | |
9736 | @@ -368,8 +368,8 @@ impl Component for AccountStatus { |
9737 | } |
9738 | } |
9739 | |
9740 | - /* self.content may have been resized with write_string_to_grid() calls above since it has |
9741 | - * growable set */ |
9742 | + /* self.content may have been resized with write_string_to_grid() calls above |
9743 | + * since it has growable set */ |
9744 | let (width, height) = self.content.size(); |
9745 | let (cols, rows) = (width!(area), height!(area)); |
9746 | self.cursor = ( |
9747 | diff --git a/src/components/mail/view.rs b/src/components/mail/view.rs |
9748 | index 88b6fb5..1661715 100644 |
9749 | --- a/src/components/mail/view.rs |
9750 | +++ b/src/components/mail/view.rs |
9751 | @@ -19,20 +19,23 @@ |
9752 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
9753 | */ |
9754 | |
9755 | - use super::*; |
9756 | - use crate::conf::accounts::JobRequest; |
9757 | - use crate::jobs::{JobId, JoinHandle}; |
9758 | - use melib::email::attachment_types::ContentType; |
9759 | - use melib::list_management; |
9760 | - use melib::parser::BytesExt; |
9761 | + use std::{ |
9762 | + collections::HashSet, |
9763 | + convert::TryFrom, |
9764 | + fmt::Write as _, |
9765 | + io::Write, |
9766 | + os::unix::fs::PermissionsExt, |
9767 | + process::{Command, Stdio}, |
9768 | + }; |
9769 | + |
9770 | + use melib::{email::attachment_types::ContentType, list_management, parser::BytesExt}; |
9771 | use smallvec::SmallVec; |
9772 | - use std::collections::HashSet; |
9773 | - use std::fmt::Write as _; |
9774 | - use std::io::Write; |
9775 | |
9776 | - use std::convert::TryFrom; |
9777 | - use std::os::unix::fs::PermissionsExt; |
9778 | - use std::process::{Command, Stdio}; |
9779 | + use super::*; |
9780 | + use crate::{ |
9781 | + conf::accounts::JobRequest, |
9782 | + jobs::{JobId, JoinHandle}, |
9783 | + }; |
9784 | |
9785 | mod html; |
9786 | pub use self::html::*; |
9787 | @@ -40,11 +43,11 @@ mod thread; |
9788 | pub use self::thread::*; |
9789 | |
9790 | mod envelope; |
9791 | - pub use self::envelope::*; |
9792 | - |
9793 | use linkify::LinkFinder; |
9794 | use xdg_utils::query_default_app; |
9795 | |
9796 | + pub use self::envelope::*; |
9797 | + |
9798 | #[derive(Debug, Default)] |
9799 | enum ForceCharset { |
9800 | #[default] |
9801 | @@ -68,8 +71,9 @@ enum Source { |
9802 | Raw, |
9803 | } |
9804 | |
9805 | - #[derive(PartialEq, Debug)] |
9806 | + #[derive(PartialEq, Debug, Default)] |
9807 | enum ViewMode { |
9808 | + #[default] |
9809 | Normal, |
9810 | Url, |
9811 | Attachment(usize), |
9812 | @@ -79,12 +83,6 @@ enum ViewMode { |
9813 | ContactSelector(Box<UIDialog<Card>>), |
9814 | } |
9815 | |
9816 | - impl Default for ViewMode { |
9817 | - fn default() -> Self { |
9818 | - ViewMode::Normal |
9819 | - } |
9820 | - } |
9821 | - |
9822 | impl ViewMode { |
9823 | /* |
9824 | fn is_ansi(&self) -> bool { |
9825 | @@ -158,8 +156,8 @@ pub enum AttachmentDisplay { |
9826 | }, |
9827 | } |
9828 | |
9829 | - /// Contains an Envelope view, with sticky headers, a pager for the body, and subviews for more |
9830 | - /// menus |
9831 | + /// Contains an Envelope view, with sticky headers, a pager for the body, and |
9832 | + /// subviews for more menus |
9833 | #[derive(Debug, Default)] |
9834 | pub struct MailView { |
9835 | coordinates: (AccountHash, MailboxHash, EnvelopeHash), |
9836 | @@ -322,7 +320,7 @@ impl Clone for MailView { |
9837 | |
9838 | impl fmt::Display for MailView { |
9839 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
9840 | - write!(f, "{}", "view mail") |
9841 | + write!(f, "view mail") |
9842 | } |
9843 | } |
9844 | |
9845 | @@ -739,7 +737,7 @@ impl MailView { |
9846 | branches, |
9847 | paths, |
9848 | cur_path, |
9849 | - iter.peek() != None, |
9850 | + iter.peek().is_some(), |
9851 | s, |
9852 | ); |
9853 | if Some(i) == default_alternative { |
9854 | @@ -795,7 +793,7 @@ impl MailView { |
9855 | .map(|s| s.as_str()) |
9856 | .unwrap_or("w3m -I utf-8 -T text/html"); |
9857 | let command_obj = Command::new("sh") |
9858 | - .args(&["-c", filter_invocation]) |
9859 | + .args(["-c", filter_invocation]) |
9860 | .stdin(Stdio::piped()) |
9861 | .stdout(Stdio::piped()) |
9862 | .spawn(); |
9863 | @@ -810,9 +808,10 @@ impl MailView { |
9864 | Some(NotificationType::Error(melib::ErrorKind::External)), |
9865 | )); |
9866 | let comment = Some(format!( |
9867 | - "Failed to start html filter process: `{}`. Press `v` to open in web browser. \n\n", |
9868 | - filter_invocation |
9869 | - )); |
9870 | + "Failed to start html filter process: `{}`. Press `v` to open in web \ |
9871 | + browser. \n\n", |
9872 | + filter_invocation |
9873 | + )); |
9874 | let text = String::from_utf8_lossy(&bytes).to_string(); |
9875 | acc.push(AttachmentDisplay::InlineText { |
9876 | inner: Box::new(a.clone()), |
9877 | @@ -975,9 +974,12 @@ impl MailView { |
9878 | #[cfg(not(feature = "gpgme"))] |
9879 | { |
9880 | acc.push(AttachmentDisplay::EncryptedFailed { |
9881 | - inner: Box::new(a.clone()), |
9882 | - error: Error::new("Cannot decrypt: meli must be compiled with libgpgme support."), |
9883 | - }); |
9884 | + inner: Box::new(a.clone()), |
9885 | + error: Error::new( |
9886 | + "Cannot decrypt: meli must be compiled with libgpgme \ |
9887 | + support.", |
9888 | + ), |
9889 | + }); |
9890 | } |
9891 | #[cfg(feature = "gpgme")] |
9892 | { |
9893 | @@ -1185,8 +1187,8 @@ impl Component for MailView { |
9894 | let y: usize = { |
9895 | let account = &context.accounts[&self.coordinates.0]; |
9896 | if !account.contains_key(self.coordinates.2) { |
9897 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
9898 | - * arrive */ |
9899 | + /* The envelope has been renamed or removed, so wait for the appropriate |
9900 | + * event to arrive */ |
9901 | return; |
9902 | } |
9903 | let envelope: EnvelopeRef = account.collection.get_env(self.coordinates.2); |
9904 | @@ -1866,7 +1868,8 @@ impl Component for MailView { |
9905 | } if handle.job_id == *job_id => { |
9906 | match handle.chan.try_recv() { |
9907 | Err(_) => { /* Job was canceled */ } |
9908 | - Ok(None) => { /* something happened, perhaps a worker thread panicked */ |
9909 | + Ok(None) => { /* something happened, perhaps a worker |
9910 | + * thread panicked */ |
9911 | } |
9912 | Ok(Some(Ok(bytes))) => { |
9913 | MailViewState::load_bytes(self, bytes, context); |
9914 | @@ -1895,7 +1898,9 @@ impl Component for MailView { |
9915 | self.initialised = false; |
9916 | match handle.chan.try_recv() { |
9917 | Err(_) => { /* Job was canceled */ } |
9918 | - Ok(None) => { /* something happened, perhaps a worker thread panicked */ |
9919 | + Ok(None) => { /* something happened, |
9920 | + * perhaps a worker thread |
9921 | + * panicked */ |
9922 | } |
9923 | Ok(Some(Ok(()))) => { |
9924 | *d = AttachmentDisplay::SignedVerified { |
9925 | @@ -1930,7 +1935,9 @@ impl Component for MailView { |
9926 | self.initialised = false; |
9927 | match handle.chan.try_recv() { |
9928 | Err(_) => { /* Job was canceled */ } |
9929 | - Ok(None) => { /* something happened, perhaps a worker thread panicked */ |
9930 | + Ok(None) => { /* something happened, |
9931 | + * perhaps a worker thread |
9932 | + * panicked */ |
9933 | } |
9934 | Ok(Some(Ok((metadata, decrypted_bytes)))) => { |
9935 | let plaintext = Box::new( |
9936 | @@ -2108,35 +2115,36 @@ impl Component for MailView { |
9937 | on_finish: Some(CallbackFn(Box::new(move |context: &mut Context| { |
9938 | match receiver.try_recv() { |
9939 | Err(_) => { /* Job was canceled */ } |
9940 | - Ok(None) => { /* something happened, perhaps a worker thread panicked */ |
9941 | + Ok(None) => { /* something happened, perhaps a worker |
9942 | + * thread panicked */ |
9943 | } |
9944 | Ok(Some(result)) => { |
9945 | match result.and_then(|bytes| { |
9946 | Composer::edit(account_hash, env_hash, &bytes, context) |
9947 | }) { |
9948 | Ok(composer) => { |
9949 | - context.replies.push_back(UIEvent::Action(Tab(New(Some( |
9950 | - Box::new(composer), |
9951 | - ))))); |
9952 | + context.replies.push_back(UIEvent::Action(Tab(New( |
9953 | + Some(Box::new(composer)), |
9954 | + )))); |
9955 | } |
9956 | Err(err) => { |
9957 | let err_string = format!( |
9958 | "Failed to open envelope {}: {}", |
9959 | context.accounts[&account_hash] |
9960 | - .collection |
9961 | - .envelopes |
9962 | - .read() |
9963 | - .unwrap() |
9964 | - .get(&env_hash) |
9965 | - .map(|env| env.message_id_display()) |
9966 | - .unwrap_or_else(|| "Not found".into()), |
9967 | + .collection |
9968 | + .envelopes |
9969 | + .read() |
9970 | + .unwrap() |
9971 | + .get(&env_hash) |
9972 | + .map(|env| env.message_id_display()) |
9973 | + .unwrap_or_else(|| "Not found".into()), |
9974 | err |
9975 | ); |
9976 | log(&err_string, ERROR); |
9977 | context.replies.push_back(UIEvent::Notification( |
9978 | - Some("Failed to open e-mail".to_string()), |
9979 | - err_string, |
9980 | - Some(NotificationType::Error(err.kind)), |
9981 | + Some("Failed to open e-mail".to_string()), |
9982 | + err_string, |
9983 | + Some(NotificationType::Error(err.kind)), |
9984 | )); |
9985 | } |
9986 | } |
9987 | @@ -2176,7 +2184,7 @@ impl Component for MailView { |
9988 | .push_back(UIEvent::StatusEvent(StatusEvent::BufClear)); |
9989 | return true; |
9990 | } |
9991 | - UIEvent::Input(Key::Char(c)) if ('0'..='9').contains(&c) => { |
9992 | + UIEvent::Input(Key::Char(c)) if c.is_ascii_digit() => { |
9993 | self.cmd_buf.push(c); |
9994 | context |
9995 | .replies |
9996 | @@ -2316,7 +2324,7 @@ impl Component for MailView { |
9997 | false, |
9998 | ); |
9999 | match Command::new("sh") |
10000 | - .args(&["-c", &exec_cmd]) |
10001 | + .args(["-c", &exec_cmd]) |
10002 | .stdin(Stdio::piped()) |
10003 | .stdout(Stdio::piped()) |
10004 | .spawn() |
10005 | @@ -2336,19 +2344,22 @@ impl Component for MailView { |
10006 | } |
10007 | } else { |
10008 | context.replies.push_back(UIEvent::StatusEvent( |
10009 | - StatusEvent::DisplayMessage(if let Some(filename) = filename.as_ref() { |
10010 | - format!( |
10011 | - "Couldn't find a default application for file {} (type {})", |
10012 | - filename, |
10013 | - attachment_type |
10014 | - ) |
10015 | - } else { |
10016 | - format!( |
10017 | - "Couldn't find a default application for type {}", |
10018 | - attachment_type |
10019 | - ) |
10020 | - }), |
10021 | - )); |
10022 | + StatusEvent::DisplayMessage( |
10023 | + if let Some(filename) = filename.as_ref() { |
10024 | + format!( |
10025 | + "Couldn't find a default application for \ |
10026 | + file {} (type {})", |
10027 | + filename, attachment_type |
10028 | + ) |
10029 | + } else { |
10030 | + format!( |
10031 | + "Couldn't find a default application for \ |
10032 | + type {}", |
10033 | + attachment_type |
10034 | + ) |
10035 | + }, |
10036 | + ), |
10037 | + )); |
10038 | } |
10039 | } |
10040 | ContentType::OctetStream { |
10041 | @@ -2357,9 +2368,10 @@ impl Component for MailView { |
10042 | } => { |
10043 | context.replies.push_back(UIEvent::StatusEvent( |
10044 | StatusEvent::DisplayMessage(format!( |
10045 | - "Failed to open {}. application/octet-stream isn't supported yet", |
10046 | - name.as_ref().map(|n| n.as_str()).unwrap_or("file") |
10047 | - )), |
10048 | + "Failed to open {}. application/octet-stream isn't \ |
10049 | + supported yet", |
10050 | + name.as_ref().map(|n| n.as_str()).unwrap_or("file") |
10051 | + )), |
10052 | )); |
10053 | } |
10054 | } |
10055 | @@ -2479,8 +2491,8 @@ impl Component for MailView { |
10056 | // Save entire message as eml |
10057 | let account = &context.accounts[&self.coordinates.0]; |
10058 | if !account.contains_key(self.coordinates.2) { |
10059 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
10060 | - * arrive */ |
10061 | + /* The envelope has been renamed or removed, so wait for the appropriate |
10062 | + * event to arrive */ |
10063 | return true; |
10064 | } |
10065 | let bytes = if let MailViewState::Loaded { ref bytes, .. } = self.state { |
10066 | @@ -2532,8 +2544,8 @@ impl Component for MailView { |
10067 | { |
10068 | let account = &context.accounts[&self.coordinates.0]; |
10069 | if !account.contains_key(self.coordinates.2) { |
10070 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
10071 | - * arrive */ |
10072 | + /* The envelope has been renamed or removed, so wait for the appropriate |
10073 | + * event to arrive */ |
10074 | return true; |
10075 | } |
10076 | } |
10077 | @@ -2626,8 +2638,8 @@ impl Component for MailView { |
10078 | UIEvent::Action(MailingListAction(ref e)) => { |
10079 | let account = &context.accounts[&self.coordinates.0]; |
10080 | if !account.contains_key(self.coordinates.2) { |
10081 | - /* The envelope has been renamed or removed, so wait for the appropriate event to |
10082 | - * arrive */ |
10083 | + /* The envelope has been renamed or removed, so wait for the appropriate |
10084 | + * event to arrive */ |
10085 | return true; |
10086 | } |
10087 | let envelope: EnvelopeRef = account.collection.get_env(self.coordinates.2); |
10088 | @@ -2661,7 +2673,7 @@ impl Component for MailView { |
10089 | return true; |
10090 | } |
10091 | MailingListAction::ListUnsubscribe if actions.unsubscribe.is_some() => { |
10092 | - /* autosend or open unsubscribe option*/ |
10093 | + /* autosend or open unsubscribe option */ |
10094 | let unsubscribe = actions.unsubscribe.as_ref().unwrap(); |
10095 | for option in unsubscribe.iter() { |
10096 | /* TODO: Ask for confirmation before proceding with an action */ |
10097 | diff --git a/src/components/mail/view/envelope.rs b/src/components/mail/view/envelope.rs |
10098 | index 616d835..d37dd32 100644 |
10099 | --- a/src/components/mail/view/envelope.rs |
10100 | +++ b/src/components/mail/view/envelope.rs |
10101 | @@ -19,12 +19,13 @@ |
10102 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
10103 | */ |
10104 | |
10105 | - use super::*; |
10106 | - use linkify::{Link, LinkFinder}; |
10107 | use std::process::{Command, Stdio}; |
10108 | |
10109 | + use linkify::{Link, LinkFinder}; |
10110 | use xdg_utils::query_default_app; |
10111 | |
10112 | + use super::*; |
10113 | + |
10114 | #[derive(PartialEq, Eq, Debug)] |
10115 | enum ViewMode { |
10116 | Normal, |
10117 | @@ -40,8 +41,8 @@ impl ViewMode { |
10118 | } |
10119 | } |
10120 | |
10121 | - /// Contains an Envelope view, with sticky headers, a pager for the body, and subviews for more |
10122 | - /// menus |
10123 | + /// Contains an Envelope view, with sticky headers, a pager for the body, and |
10124 | + /// subviews for more menus |
10125 | #[derive(Debug)] |
10126 | pub struct EnvelopeView { |
10127 | pager: Option<Pager>, |
10128 | @@ -91,7 +92,7 @@ impl EnvelopeView { |
10129 | let settings = &context.settings; |
10130 | if let Some(filter_invocation) = settings.pager.html_filter.as_ref() { |
10131 | let command_obj = Command::new("sh") |
10132 | - .args(&["-c", filter_invocation]) |
10133 | + .args(["-c", filter_invocation]) |
10134 | .stdin(Stdio::piped()) |
10135 | .stdout(Stdio::piped()) |
10136 | .spawn(); |
10137 | @@ -114,9 +115,10 @@ impl EnvelopeView { |
10138 | .write_all(v) |
10139 | .expect("Failed to write to stdin"); |
10140 | *v = format!( |
10141 | - "Text piped through `{}`. Press `v` to open in web browser. \n\n", |
10142 | - filter_invocation |
10143 | - ) |
10144 | + "Text piped through `{}`. Press `v` to open in web browser. \ |
10145 | + \n\n", |
10146 | + filter_invocation |
10147 | + ) |
10148 | .into_bytes(); |
10149 | v.extend(html_filter.wait_with_output().unwrap().stdout); |
10150 | } |
10151 | @@ -372,7 +374,7 @@ impl Component for EnvelopeView { |
10152 | .push_back(UIEvent::StatusEvent(StatusEvent::BufClear)); |
10153 | return true; |
10154 | } |
10155 | - UIEvent::Input(Key::Char(c)) if ('0'..='9').contains(&c) => { |
10156 | + UIEvent::Input(Key::Char(c)) if c.is_ascii_digit() => { |
10157 | self.cmd_buf.push(c); |
10158 | return true; |
10159 | } |
10160 | @@ -449,7 +451,7 @@ impl Component for EnvelopeView { |
10161 | false, |
10162 | ); |
10163 | match Command::new("sh") |
10164 | - .args(&["-c", &exec_cmd]) |
10165 | + .args(["-c", &exec_cmd]) |
10166 | .stdin(Stdio::piped()) |
10167 | .stdout(Stdio::piped()) |
10168 | .spawn() |
10169 | @@ -469,18 +471,20 @@ impl Component for EnvelopeView { |
10170 | } |
10171 | } else { |
10172 | context.replies.push_back(UIEvent::StatusEvent( |
10173 | - StatusEvent::DisplayMessage(if let Some(filename) = filename.as_ref() { |
10174 | + StatusEvent::DisplayMessage( |
10175 | + if let Some(filename) = filename.as_ref() { |
10176 | format!( |
10177 | - "Couldn't find a default application for file {} (type {})", |
10178 | - filename, |
10179 | - attachment_type |
10180 | + "Couldn't find a default application for file {} \ |
10181 | + (type {})", |
10182 | + filename, attachment_type |
10183 | ) |
10184 | } else { |
10185 | format!( |
10186 | "Couldn't find a default application for type {}", |
10187 | attachment_type |
10188 | ) |
10189 | - }), |
10190 | + }, |
10191 | + ), |
10192 | )); |
10193 | return true; |
10194 | } |
10195 | diff --git a/src/components/mail/view/html.rs b/src/components/mail/view/html.rs |
10196 | index d533456..b319ee8 100644 |
10197 | --- a/src/components/mail/view/html.rs |
10198 | +++ b/src/components/mail/view/html.rs |
10199 | @@ -19,9 +19,12 @@ |
10200 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
10201 | */ |
10202 | |
10203 | + use std::{ |
10204 | + io::Write, |
10205 | + process::{Command, Stdio}, |
10206 | + }; |
10207 | + |
10208 | use super::*; |
10209 | - use std::io::Write; |
10210 | - use std::process::{Command, Stdio}; |
10211 | |
10212 | #[derive(Debug)] |
10213 | pub struct HtmlView { |
10214 | @@ -40,7 +43,7 @@ impl HtmlView { |
10215 | let mut display_text = if let Some(filter_invocation) = settings.pager.html_filter.as_ref() |
10216 | { |
10217 | let command_obj = Command::new("sh") |
10218 | - .args(&["-c", filter_invocation]) |
10219 | + .args(["-c", filter_invocation]) |
10220 | .stdin(Stdio::piped()) |
10221 | .stdout(Stdio::piped()) |
10222 | .spawn(); |
10223 | @@ -74,7 +77,7 @@ impl HtmlView { |
10224 | } |
10225 | } |
10226 | } else if let Ok(mut html_filter) = Command::new("w3m") |
10227 | - .args(&["-I", "utf-8", "-T", "text/html"]) |
10228 | + .args(["-I", "utf-8", "-T", "text/html"]) |
10229 | .stdin(Stdio::piped()) |
10230 | .stdout(Stdio::piped()) |
10231 | .spawn() |
10232 | @@ -154,7 +157,7 @@ impl Component for HtmlView { |
10233 | let exec_cmd = |
10234 | super::desktop_exec_to_command(&command, p.path.display().to_string(), false); |
10235 | match Command::new("sh") |
10236 | - .args(&["-c", &exec_cmd]) |
10237 | + .args(["-c", &exec_cmd]) |
10238 | .stdin(Stdio::piped()) |
10239 | .stdout(Stdio::piped()) |
10240 | .spawn() |
10241 | diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs |
10242 | index d2ce3f4..ea74269 100644 |
10243 | --- a/src/components/mail/view/thread.rs |
10244 | +++ b/src/components/mail/view/thread.rs |
10245 | @@ -19,9 +19,10 @@ |
10246 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
10247 | */ |
10248 | |
10249 | + use std::cmp; |
10250 | + |
10251 | use super::*; |
10252 | use crate::components::PageMovement; |
10253 | - use std::cmp; |
10254 | |
10255 | #[derive(Debug, Clone)] |
10256 | struct ThreadEntry { |
10257 | @@ -62,8 +63,8 @@ pub struct ThreadView { |
10258 | impl ThreadView { |
10259 | /* |
10260 | * coordinates: (account index, mailbox_hash, root set thread_node index) |
10261 | - * expanded_hash: optional position of expanded entry when we render the threadview. Default |
10262 | - * expanded message is the last one. |
10263 | + * expanded_hash: optional position of expanded entry when we render the |
10264 | + * threadview. Default expanded message is the last one. |
10265 | * context: current context |
10266 | */ |
10267 | pub fn new( |
10268 | @@ -491,8 +492,8 @@ impl ThreadView { |
10269 | let page_no = (self.new_cursor_pos).wrapping_div(rows); |
10270 | |
10271 | let top_idx = page_no * rows; |
10272 | - /* This closure (written for code clarity, should be inlined by the compiler) returns the |
10273 | - * **line** of an entry in the ThreadView grid. */ |
10274 | + /* This closure (written for code clarity, should be inlined by the compiler) |
10275 | + * returns the **line** of an entry in the ThreadView grid. */ |
10276 | let get_entry_area = |idx: usize, entries: &[ThreadEntry]| { |
10277 | let entries = &entries; |
10278 | let visual_indentation = entries[idx].index.0 * 4; |
10279 | @@ -530,8 +531,8 @@ impl ThreadView { |
10280 | ), |
10281 | ); |
10282 | } |
10283 | - /* If cursor position has changed, remove the highlight from the previous position and |
10284 | - * apply it in the new one. */ |
10285 | + /* If cursor position has changed, remove the highlight from the previous |
10286 | + * position and apply it in the new one. */ |
10287 | self.cursor_pos = self.new_cursor_pos; |
10288 | if self.cursor_pos + 1 > visibles.len() { |
10289 | self.cursor_pos = visibles.len().saturating_sub(1); |
10290 | @@ -588,8 +589,8 @@ impl ThreadView { |
10291 | } else { |
10292 | let old_cursor_pos = self.cursor_pos; |
10293 | self.cursor_pos = self.new_cursor_pos; |
10294 | - /* If cursor position has changed, remove the highlight from the previous position and |
10295 | - * apply it in the new one. */ |
10296 | + /* If cursor position has changed, remove the highlight from the previous |
10297 | + * position and apply it in the new one. */ |
10298 | let visibles: Vec<&usize> = |
10299 | self.visible_entries.iter().flat_map(|v| v.iter()).collect(); |
10300 | for &idx in &[old_cursor_pos, self.cursor_pos] { |
10301 | @@ -941,7 +942,8 @@ impl ThreadView { |
10302 | } |
10303 | } |
10304 | |
10305 | - /// Current position in self.entries (not in drawn entries which might exclude nonvisible ones) |
10306 | + /// Current position in self.entries (not in drawn entries which might |
10307 | + /// exclude nonvisible ones) |
10308 | fn current_pos(&self) -> usize { |
10309 | let visibles: Vec<&usize> = self.visible_entries.iter().flat_map(|v| v.iter()).collect(); |
10310 | *visibles[self.new_cursor_pos] |
10311 | diff --git a/src/components/mailbox_management.rs b/src/components/mailbox_management.rs |
10312 | index 5e8cce5..1da104d 100644 |
10313 | --- a/src/components/mailbox_management.rs |
10314 | +++ b/src/components/mailbox_management.rs |
10315 | @@ -18,12 +18,12 @@ |
10316 | * You should have received a copy of the GNU General Public License |
10317 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
10318 | */ |
10319 | - use super::*; |
10320 | - use crate::conf::accounts::MailboxEntry; |
10321 | - use crate::melib::text_processing::TextProcessing; |
10322 | + use std::cmp; |
10323 | + |
10324 | use melib::backends::AccountHash; |
10325 | |
10326 | - use std::cmp; |
10327 | + use super::*; |
10328 | + use crate::{conf::accounts::MailboxEntry, melib::text_processing::TextProcessing}; |
10329 | |
10330 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
10331 | enum MailboxAction { |
10332 | @@ -63,7 +63,7 @@ pub struct MailboxManager { |
10333 | |
10334 | impl fmt::Display for MailboxManager { |
10335 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
10336 | - write!(f, "{}", "mailboxes") |
10337 | + write!(f, "mailboxes") |
10338 | } |
10339 | } |
10340 | |
10341 | @@ -96,7 +96,7 @@ impl MailboxManager { |
10342 | self.length = account.mailbox_entries.len(); |
10343 | self.entries = account.mailbox_entries.clone(); |
10344 | self.entries |
10345 | - .sort_by(|_, a, _, b| a.ref_mailbox.path().cmp(&b.ref_mailbox.path())); |
10346 | + .sort_by(|_, a, _, b| a.ref_mailbox.path().cmp(b.ref_mailbox.path())); |
10347 | |
10348 | self.set_dirty(true); |
10349 | let mut min_width = ( |
10350 | @@ -268,8 +268,8 @@ impl MailboxManager { |
10351 | ))); |
10352 | } |
10353 | |
10354 | - /* If cursor position has changed, remove the highlight from the previous position and |
10355 | - * apply it in the new one. */ |
10356 | + /* If cursor position has changed, remove the highlight from the previous |
10357 | + * position and apply it in the new one. */ |
10358 | if self.cursor_pos != self.new_cursor_pos && prev_page_no == page_no { |
10359 | let old_cursor_pos = self.cursor_pos; |
10360 | self.cursor_pos = self.new_cursor_pos; |
10361 | @@ -362,11 +362,13 @@ impl Component for MailboxManager { |
10362 | MailboxAction::Move | MailboxAction::Rename => { |
10363 | context.replies.push_back(UIEvent::CmdInput(Key::Paste( |
10364 | format!( |
10365 | - "rename-mailbox \"{account_name}\" \"{mailbox_path_src}\" ", |
10366 | - account_name = context.accounts[&self.account_hash].name(), |
10367 | - mailbox_path_src = |
10368 | - self.entries[self.cursor_pos].ref_mailbox.path() |
10369 | - ), |
10370 | + "rename-mailbox \"{account_name}\" \ |
10371 | + \"{mailbox_path_src}\" ", |
10372 | + account_name = |
10373 | + context.accounts[&self.account_hash].name(), |
10374 | + mailbox_path_src = |
10375 | + self.entries[self.cursor_pos].ref_mailbox.path() |
10376 | + ), |
10377 | ))); |
10378 | context |
10379 | .replies |
10380 | diff --git a/src/components/notifications.rs b/src/components/notifications.rs |
10381 | index 3d959a6..c03f15d 100644 |
10382 | --- a/src/components/notifications.rs |
10383 | +++ b/src/components/notifications.rs |
10384 | @@ -24,11 +24,11 @@ Notification handling components. |
10385 | */ |
10386 | use std::process::{Command, Stdio}; |
10387 | |
10388 | - use super::*; |
10389 | - |
10390 | #[cfg(all(target_os = "linux", feature = "dbus-notifications"))] |
10391 | pub use dbus::*; |
10392 | |
10393 | + use super::*; |
10394 | + |
10395 | #[cfg(all(target_os = "linux", feature = "dbus-notifications"))] |
10396 | mod dbus { |
10397 | use super::*; |
10398 | @@ -230,7 +230,20 @@ impl Component for NotificationCommand { |
10399 | } else { |
10400 | #[cfg(target_os = "macos")] |
10401 | { |
10402 | - let applescript = format!("display notification \"{message}\" with title \"{title}\" subtitle \"{subtitle}\"", message = body.replace('"', "'"), title = title.as_ref().map(String::as_str).unwrap_or("meli").replace('"', "'"), subtitle = kind.map(|k| k.to_string()).unwrap_or_default().replace('"', "'")); |
10403 | + let applescript = format!( |
10404 | + "display notification \"{message}\" with title \"{title}\" subtitle \ |
10405 | + \"{subtitle}\"", |
10406 | + message = body.replace('"', "'"), |
10407 | + title = title |
10408 | + .as_ref() |
10409 | + .map(String::as_str) |
10410 | + .unwrap_or("meli") |
10411 | + .replace('"', "'"), |
10412 | + subtitle = kind |
10413 | + .map(|k| k.to_string()) |
10414 | + .unwrap_or_default() |
10415 | + .replace('"', "'") |
10416 | + ); |
10417 | match Command::new("osascript") |
10418 | .arg("-e") |
10419 | .arg(applescript) |
10420 | @@ -279,7 +292,7 @@ impl Component for NotificationCommand { |
10421 | fn update_xbiff(path: &str) -> Result<()> { |
10422 | let mut file = std::fs::OpenOptions::new() |
10423 | .append(true) /* writes will append to a file instead of overwriting previous contents */ |
10424 | - .create(true) /* a new file will be created if the file does not yet already exist.*/ |
10425 | + .create(true) /* a new file will be created if the file does not yet already exist. */ |
10426 | .open(path)?; |
10427 | if file.metadata()?.len() > 128 { |
10428 | file.set_len(0)?; |
10429 | diff --git a/src/components/svg.rs b/src/components/svg.rs |
10430 | index 048867f..c49c244 100644 |
10431 | --- a/src/components/svg.rs |
10432 | +++ b/src/components/svg.rs |
10433 | @@ -18,9 +18,9 @@ |
10434 | * You should have received a copy of the GNU General Public License |
10435 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
10436 | */ |
10437 | + use std::{collections::BTreeMap, io::Write}; |
10438 | + |
10439 | use super::*; |
10440 | - use std::collections::BTreeMap; |
10441 | - use std::io::Write; |
10442 | |
10443 | #[derive(Debug)] |
10444 | pub struct SVGScreenshotFilter { |
10445 | @@ -48,22 +48,29 @@ impl Component for SVGScreenshotFilter { |
10446 | } |
10447 | self.save_screenshot = false; |
10448 | let grid: &CellBuffer = _grid; |
10449 | - use svg_crate::node::element::{Definitions, Group, Rectangle, Style, Text, Use}; |
10450 | - use svg_crate::node::Text as TextNode; |
10451 | - use svg_crate::Document; |
10452 | + use svg_crate::{ |
10453 | + node::{ |
10454 | + element::{Definitions, Group, Rectangle, Style, Text, Use}, |
10455 | + Text as TextNode, |
10456 | + }, |
10457 | + Document, |
10458 | + }; |
10459 | |
10460 | let (width, height) = grid.size(); |
10461 | /* |
10462 | * Format frame as follows: |
10463 | * - The entire background is a big rectangle. |
10464 | - * - Every text piece with unified foreground color is a text element inserted into the |
10465 | + * - Every text piece with unified foreground color is a text element |
10466 | + * inserted into the |
10467 | * `definitions` field of the svg, and then `use`ed as a reference |
10468 | - * - Every background piece (a slice of unified background color) is a rectangle element |
10469 | + * - Every background piece (a slice of unified background color) is a |
10470 | + * rectangle element |
10471 | * inserted along with the `use` elements |
10472 | * |
10473 | - * Each row is arbritarily set at 17px high, and each character cell is 8 pixels wide. |
10474 | - * Rectangle cells each have one extra pixel (so 18px * 9px) in their dimensions in order |
10475 | - * to cover the spacing between cells. |
10476 | + * Each row is arbritarily set at 17px high, and each character cell is 8 |
10477 | + * pixels wide. Rectangle cells each have one extra pixel (so 18px * |
10478 | + * 9px) in their dimensions in order to cover the spacing between |
10479 | + * cells. |
10480 | */ |
10481 | let mut definitions = Definitions::new(); |
10482 | let mut rows_group = Group::new(); |
10483 | @@ -79,9 +86,11 @@ impl Component for SVGScreenshotFilter { |
10484 | /* Each row is a <g> group element, consisting of text elements */ |
10485 | let mut row_group = Group::new().set("id", format!("{:x}", row_idx + 1)); |
10486 | /* Keep track of colors and attributes. |
10487 | - * - Whenever the foreground color changes, emit a text element with the accumulated |
10488 | + * - Whenever the foreground color changes, emit a text element with the |
10489 | + * accumulated |
10490 | * text in the specific foreground color. |
10491 | - * - Whenever the backgrund color changes, emit a rectangle element filled with the |
10492 | + * - Whenever the backgrund color changes, emit a rectangle element filled |
10493 | + * with the |
10494 | * specific background color. |
10495 | */ |
10496 | let mut cur_fg = Color::Default; |
10497 | @@ -151,7 +160,7 @@ impl Component for SVGScreenshotFilter { |
10498 | .add(TextNode::new(&escaped_text)) |
10499 | .set("x", prev_x_fg * 8) |
10500 | .set("textLength", text_length * 8); |
10501 | - /*.set("fgname", format!("{:?}", cur_fg));*/ |
10502 | + /* .set("fgname", format!("{:?}", cur_fg)); */ |
10503 | if cur_attrs.intersects(Attr::BOLD) { |
10504 | text_el = text_el.set("font-weight", "bold"); |
10505 | } |
10506 | @@ -275,7 +284,7 @@ impl Component for SVGScreenshotFilter { |
10507 | .add(TextNode::new(&escaped_text)) |
10508 | .set("x", prev_x_fg * 8) |
10509 | .set("textLength", text_length * 8); |
10510 | - /*.set("fgname", format!("{:?}", cur_fg));*/ |
10511 | + /* .set("fgname", format!("{:?}", cur_fg)); */ |
10512 | if cur_attrs.intersects(Attr::BOLD) { |
10513 | text_el = text_el.set("font-weight", "bold"); |
10514 | } |
10515 | @@ -441,260 +450,260 @@ impl Component for SVGScreenshotFilter { |
10516 | const CSS_STYLE: &str = r#"#t{font-family:'DejaVu Sans Mono',monospace;font-style:normal;font-size:14px;} text {dominant-baseline: text-before-edge; white-space: pre;} .f{fill:#e5e5e5;} .b{fill:#000;} .c0 {fill:#000;} .c1 {fill:#cd0000;} .c2 {fill:#00cd00;} .c3 {fill:#cdcd00;} .c4 {fill:#00e;} .c5 {fill:#cd00cd;} .c6 {fill:#00cdcd;} .c7 {fill:#e5e5e5;} .c8 {fill:#7f7f7f;} .c9 {fill:#f00;} .c10 {fill:#0f0;} .c11 {fill:#ff0;} .c12 {fill:#5c5cff;} .c13 {fill:#f0f;} .c14 {fill:#0ff;} .c15 {fill:#fff;}"#; |
10517 | |
10518 | const XTERM_COLORS: &[(u8, u8, u8)] = &[ |
10519 | - /*0*/ (0, 0, 0), |
10520 | - /*1*/ (128, 0, 0), |
10521 | - /*2*/ (0, 128, 0), |
10522 | - /*3*/ (128, 128, 0), |
10523 | - /*4*/ (0, 0, 128), |
10524 | - /*5*/ (128, 0, 128), |
10525 | - /*6*/ (0, 128, 128), |
10526 | - /*7*/ (192, 192, 192), |
10527 | - /*8*/ (128, 128, 128), |
10528 | - /*9*/ (255, 0, 0), |
10529 | - /*10*/ (0, 255, 0), |
10530 | - /*11*/ (255, 255, 0), |
10531 | - /*12*/ (0, 0, 255), |
10532 | - /*13*/ (255, 0, 255), |
10533 | - /*14*/ (0, 255, 255), |
10534 | - /*15*/ (255, 255, 255), |
10535 | - /*16*/ (0, 0, 0), |
10536 | - /*17*/ (0, 0, 95), |
10537 | - /*18*/ (0, 0, 135), |
10538 | - /*19*/ (0, 0, 175), |
10539 | - /*20*/ (0, 0, 215), |
10540 | - /*21*/ (0, 0, 255), |
10541 | - /*22*/ (0, 95, 0), |
10542 | - /*23*/ (0, 95, 95), |
10543 | - /*24*/ (0, 95, 135), |
10544 | - /*25*/ (0, 95, 175), |
10545 | - /*26*/ (0, 95, 215), |
10546 | - /*27*/ (0, 95, 255), |
10547 | - /*28*/ (0, 135, 0), |
10548 | - /*29*/ (0, 135, 95), |
10549 | - /*30*/ (0, 135, 135), |
10550 | - /*31*/ (0, 135, 175), |
10551 | - /*32*/ (0, 135, 215), |
10552 | - /*33*/ (0, 135, 255), |
10553 | - /*34*/ (0, 175, 0), |
10554 | - /*35*/ (0, 175, 95), |
10555 | - /*36*/ (0, 175, 135), |
10556 | - /*37*/ (0, 175, 175), |
10557 | - /*38*/ (0, 175, 215), |
10558 | - /*39*/ (0, 175, 255), |
10559 | - /*40*/ (0, 215, 0), |
10560 | - /*41*/ (0, 215, 95), |
10561 | - /*42*/ (0, 215, 135), |
10562 | - /*43*/ (0, 215, 175), |
10563 | - /*44*/ (0, 215, 215), |
10564 | - /*45*/ (0, 215, 255), |
10565 | - /*46*/ (0, 255, 0), |
10566 | - /*47*/ (0, 255, 95), |
10567 | - /*48*/ (0, 255, 135), |
10568 | - /*49*/ (0, 255, 175), |
10569 | - /*50*/ (0, 255, 215), |
10570 | - /*51*/ (0, 255, 255), |
10571 | - /*52*/ (95, 0, 0), |
10572 | - /*53*/ (95, 0, 95), |
10573 | - /*54*/ (95, 0, 135), |
10574 | - /*55*/ (95, 0, 175), |
10575 | - /*56*/ (95, 0, 215), |
10576 | - /*57*/ (95, 0, 255), |
10577 | - /*58*/ (95, 95, 0), |
10578 | - /*59*/ (95, 95, 95), |
10579 | - /*60*/ (95, 95, 135), |
10580 | - /*61*/ (95, 95, 175), |
10581 | - /*62*/ (95, 95, 215), |
10582 | - /*63*/ (95, 95, 255), |
10583 | - /*64*/ (95, 135, 0), |
10584 | - /*65*/ (95, 135, 95), |
10585 | - /*66*/ (95, 135, 135), |
10586 | - /*67*/ (95, 135, 175), |
10587 | - /*68*/ (95, 135, 215), |
10588 | - /*69*/ (95, 135, 255), |
10589 | - /*70*/ (95, 175, 0), |
10590 | - /*71*/ (95, 175, 95), |
10591 | - /*72*/ (95, 175, 135), |
10592 | - /*73*/ (95, 175, 175), |
10593 | - /*74*/ (95, 175, 215), |
10594 | - /*75*/ (95, 175, 255), |
10595 | - /*76*/ (95, 215, 0), |
10596 | - /*77*/ (95, 215, 95), |
10597 | - /*78*/ (95, 215, 135), |
10598 | - /*79*/ (95, 215, 175), |
10599 | - /*80*/ (95, 215, 215), |
10600 | - /*81*/ (95, 215, 255), |
10601 | - /*82*/ (95, 255, 0), |
10602 | - /*83*/ (95, 255, 95), |
10603 | - /*84*/ (95, 255, 135), |
10604 | - /*85*/ (95, 255, 175), |
10605 | - /*86*/ (95, 255, 215), |
10606 | - /*87*/ (95, 255, 255), |
10607 | - /*88*/ (135, 0, 0), |
10608 | - /*89*/ (135, 0, 95), |
10609 | - /*90*/ (135, 0, 135), |
10610 | - /*91*/ (135, 0, 175), |
10611 | - /*92*/ (135, 0, 215), |
10612 | - /*93*/ (135, 0, 255), |
10613 | - /*94*/ (135, 95, 0), |
10614 | - /*95*/ (135, 95, 95), |
10615 | - /*96*/ (135, 95, 135), |
10616 | - /*97*/ (135, 95, 175), |
10617 | - /*98*/ (135, 95, 215), |
10618 | - /*99*/ (135, 95, 255), |
10619 | - /*100*/ (135, 135, 0), |
10620 | - /*101*/ (135, 135, 95), |
10621 | - /*102*/ (135, 135, 135), |
10622 | - /*103*/ (135, 135, 175), |
10623 | - /*104*/ (135, 135, 215), |
10624 | - /*105*/ (135, 135, 255), |
10625 | - /*106*/ (135, 175, 0), |
10626 | - /*107*/ (135, 175, 95), |
10627 | - /*108*/ (135, 175, 135), |
10628 | - /*109*/ (135, 175, 175), |
10629 | - /*110*/ (135, 175, 215), |
10630 | - /*111*/ (135, 175, 255), |
10631 | - /*112*/ (135, 215, 0), |
10632 | - /*113*/ (135, 215, 95), |
10633 | - /*114*/ (135, 215, 135), |
10634 | - /*115*/ (135, 215, 175), |
10635 | - /*116*/ (135, 215, 215), |
10636 | - /*117*/ (135, 215, 255), |
10637 | - /*118*/ (135, 255, 0), |
10638 | - /*119*/ (135, 255, 95), |
10639 | - /*120*/ (135, 255, 135), |
10640 | - /*121*/ (135, 255, 175), |
10641 | - /*122*/ (135, 255, 215), |
10642 | - /*123*/ (135, 255, 255), |
10643 | - /*124*/ (175, 0, 0), |
10644 | - /*125*/ (175, 0, 95), |
10645 | - /*126*/ (175, 0, 135), |
10646 | - /*127*/ (175, 0, 175), |
10647 | - /*128*/ (175, 0, 215), |
10648 | - /*129*/ (175, 0, 255), |
10649 | - /*130*/ (175, 95, 0), |
10650 | - /*131*/ (175, 95, 95), |
10651 | - /*132*/ (175, 95, 135), |
10652 | - /*133*/ (175, 95, 175), |
10653 | - /*134*/ (175, 95, 215), |
10654 | - /*135*/ (175, 95, 255), |
10655 | - /*136*/ (175, 135, 0), |
10656 | - /*137*/ (175, 135, 95), |
10657 | - /*138*/ (175, 135, 135), |
10658 | - /*139*/ (175, 135, 175), |
10659 | - /*140*/ (175, 135, 215), |
10660 | - /*141*/ (175, 135, 255), |
10661 | - /*142*/ (175, 175, 0), |
10662 | - /*143*/ (175, 175, 95), |
10663 | - /*144*/ (175, 175, 135), |
10664 | - /*145*/ (175, 175, 175), |
10665 | - /*146*/ (175, 175, 215), |
10666 | - /*147*/ (175, 175, 255), |
10667 | - /*148*/ (175, 215, 0), |
10668 | - /*149*/ (175, 215, 95), |
10669 | - /*150*/ (175, 215, 135), |
10670 | - /*151*/ (175, 215, 175), |
10671 | - /*152*/ (175, 215, 215), |
10672 | - /*153*/ (175, 215, 255), |
10673 | - /*154*/ (175, 255, 0), |
10674 | - /*155*/ (175, 255, 95), |
10675 | - /*156*/ (175, 255, 135), |
10676 | - /*157*/ (175, 255, 175), |
10677 | - /*158*/ (175, 255, 215), |
10678 | - /*159*/ (175, 255, 255), |
10679 | - /*160*/ (215, 0, 0), |
10680 | - /*161*/ (215, 0, 95), |
10681 | - /*162*/ (215, 0, 135), |
10682 | - /*163*/ (215, 0, 175), |
10683 | - /*164*/ (215, 0, 215), |
10684 | - /*165*/ (215, 0, 255), |
10685 | - /*166*/ (215, 95, 0), |
10686 | - /*167*/ (215, 95, 95), |
10687 | - /*168*/ (215, 95, 135), |
10688 | - /*169*/ (215, 95, 175), |
10689 | - /*170*/ (215, 95, 215), |
10690 | - /*171*/ (215, 95, 255), |
10691 | - /*172*/ (215, 135, 0), |
10692 | - /*173*/ (215, 135, 95), |
10693 | - /*174*/ (215, 135, 135), |
10694 | - /*175*/ (215, 135, 175), |
10695 | - /*176*/ (215, 135, 215), |
10696 | - /*177*/ (215, 135, 255), |
10697 | - /*178*/ (215, 175, 0), |
10698 | - /*179*/ (215, 175, 95), |
10699 | - /*180*/ (215, 175, 135), |
10700 | - /*181*/ (215, 175, 175), |
10701 | - /*182*/ (215, 175, 215), |
10702 | - /*183*/ (215, 175, 255), |
10703 | - /*184*/ (215, 215, 0), |
10704 | - /*185*/ (215, 215, 95), |
10705 | - /*186*/ (215, 215, 135), |
10706 | - /*187*/ (215, 215, 175), |
10707 | - /*188*/ (215, 215, 215), |
10708 | - /*189*/ (215, 215, 255), |
10709 | - /*190*/ (215, 255, 0), |
10710 | - /*191*/ (215, 255, 95), |
10711 | - /*192*/ (215, 255, 135), |
10712 | - /*193*/ (215, 255, 175), |
10713 | - /*194*/ (215, 255, 215), |
10714 | - /*195*/ (215, 255, 255), |
10715 | - /*196*/ (255, 0, 0), |
10716 | - /*197*/ (255, 0, 95), |
10717 | - /*198*/ (255, 0, 135), |
10718 | - /*199*/ (255, 0, 175), |
10719 | - /*200*/ (255, 0, 215), |
10720 | - /*201*/ (255, 0, 255), |
10721 | - /*202*/ (255, 95, 0), |
10722 | - /*203*/ (255, 95, 95), |
10723 | - /*204*/ (255, 95, 135), |
10724 | - /*205*/ (255, 95, 175), |
10725 | - /*206*/ (255, 95, 215), |
10726 | - /*207*/ (255, 95, 255), |
10727 | - /*208*/ (255, 135, 0), |
10728 | - /*209*/ (255, 135, 95), |
10729 | - /*210*/ (255, 135, 135), |
10730 | - /*211*/ (255, 135, 175), |
10731 | - /*212*/ (255, 135, 215), |
10732 | - /*213*/ (255, 135, 255), |
10733 | - /*214*/ (255, 175, 0), |
10734 | - /*215*/ (255, 175, 95), |
10735 | - /*216*/ (255, 175, 135), |
10736 | - /*217*/ (255, 175, 175), |
10737 | - /*218*/ (255, 175, 215), |
10738 | - /*219*/ (255, 175, 255), |
10739 | - /*220*/ (255, 215, 0), |
10740 | - /*221*/ (255, 215, 95), |
10741 | - /*222*/ (255, 215, 135), |
10742 | - /*223*/ (255, 215, 175), |
10743 | - /*224*/ (255, 215, 215), |
10744 | - /*225*/ (255, 215, 255), |
10745 | - /*226*/ (255, 255, 0), |
10746 | - /*227*/ (255, 255, 95), |
10747 | - /*228*/ (255, 255, 135), |
10748 | - /*229*/ (255, 255, 175), |
10749 | - /*230*/ (255, 255, 215), |
10750 | - /*231*/ (255, 255, 255), |
10751 | - /*232*/ (8, 8, 8), |
10752 | - /*233*/ (18, 18, 18), |
10753 | - /*234*/ (28, 28, 28), |
10754 | - /*235*/ (38, 38, 38), |
10755 | - /*236*/ (48, 48, 48), |
10756 | - /*237*/ (58, 58, 58), |
10757 | - /*238*/ (68, 68, 68), |
10758 | - /*239*/ (78, 78, 78), |
10759 | - /*240*/ (88, 88, 88), |
10760 | - /*241*/ (98, 98, 98), |
10761 | - /*242*/ (108, 108, 108), |
10762 | - /*243*/ (118, 118, 118), |
10763 | - /*244*/ (128, 128, 128), |
10764 | - /*245*/ (138, 138, 138), |
10765 | - /*246*/ (148, 148, 148), |
10766 | - /*247*/ (158, 158, 158), |
10767 | - /*248*/ (168, 168, 168), |
10768 | - /*249*/ (178, 178, 178), |
10769 | - /*250*/ (188, 188, 188), |
10770 | - /*251*/ (198, 198, 198), |
10771 | - /*252*/ (208, 208, 208), |
10772 | - /*253*/ (218, 218, 218), |
10773 | - /*254*/ (228, 228, 228), |
10774 | - /*255*/ (238, 238, 238), |
10775 | + /* 0 */ (0, 0, 0), |
10776 | + /* 1 */ (128, 0, 0), |
10777 | + /* 2 */ (0, 128, 0), |
10778 | + /* 3 */ (128, 128, 0), |
10779 | + /* 4 */ (0, 0, 128), |
10780 | + /* 5 */ (128, 0, 128), |
10781 | + /* 6 */ (0, 128, 128), |
10782 | + /* 7 */ (192, 192, 192), |
10783 | + /* 8 */ (128, 128, 128), |
10784 | + /* 9 */ (255, 0, 0), |
10785 | + /* 10 */ (0, 255, 0), |
10786 | + /* 11 */ (255, 255, 0), |
10787 | + /* 12 */ (0, 0, 255), |
10788 | + /* 13 */ (255, 0, 255), |
10789 | + /* 14 */ (0, 255, 255), |
10790 | + /* 15 */ (255, 255, 255), |
10791 | + /* 16 */ (0, 0, 0), |
10792 | + /* 17 */ (0, 0, 95), |
10793 | + /* 18 */ (0, 0, 135), |
10794 | + /* 19 */ (0, 0, 175), |
10795 | + /* 20 */ (0, 0, 215), |
10796 | + /* 21 */ (0, 0, 255), |
10797 | + /* 22 */ (0, 95, 0), |
10798 | + /* 23 */ (0, 95, 95), |
10799 | + /* 24 */ (0, 95, 135), |
10800 | + /* 25 */ (0, 95, 175), |
10801 | + /* 26 */ (0, 95, 215), |
10802 | + /* 27 */ (0, 95, 255), |
10803 | + /* 28 */ (0, 135, 0), |
10804 | + /* 29 */ (0, 135, 95), |
10805 | + /* 30 */ (0, 135, 135), |
10806 | + /* 31 */ (0, 135, 175), |
10807 | + /* 32 */ (0, 135, 215), |
10808 | + /* 33 */ (0, 135, 255), |
10809 | + /* 34 */ (0, 175, 0), |
10810 | + /* 35 */ (0, 175, 95), |
10811 | + /* 36 */ (0, 175, 135), |
10812 | + /* 37 */ (0, 175, 175), |
10813 | + /* 38 */ (0, 175, 215), |
10814 | + /* 39 */ (0, 175, 255), |
10815 | + /* 40 */ (0, 215, 0), |
10816 | + /* 41 */ (0, 215, 95), |
10817 | + /* 42 */ (0, 215, 135), |
10818 | + /* 43 */ (0, 215, 175), |
10819 | + /* 44 */ (0, 215, 215), |
10820 | + /* 45 */ (0, 215, 255), |
10821 | + /* 46 */ (0, 255, 0), |
10822 | + /* 47 */ (0, 255, 95), |
10823 | + /* 48 */ (0, 255, 135), |
10824 | + /* 49 */ (0, 255, 175), |
10825 | + /* 50 */ (0, 255, 215), |
10826 | + /* 51 */ (0, 255, 255), |
10827 | + /* 52 */ (95, 0, 0), |
10828 | + /* 53 */ (95, 0, 95), |
10829 | + /* 54 */ (95, 0, 135), |
10830 | + /* 55 */ (95, 0, 175), |
10831 | + /* 56 */ (95, 0, 215), |
10832 | + /* 57 */ (95, 0, 255), |
10833 | + /* 58 */ (95, 95, 0), |
10834 | + /* 59 */ (95, 95, 95), |
10835 | + /* 60 */ (95, 95, 135), |
10836 | + /* 61 */ (95, 95, 175), |
10837 | + /* 62 */ (95, 95, 215), |
10838 | + /* 63 */ (95, 95, 255), |
10839 | + /* 64 */ (95, 135, 0), |
10840 | + /* 65 */ (95, 135, 95), |
10841 | + /* 66 */ (95, 135, 135), |
10842 | + /* 67 */ (95, 135, 175), |
10843 | + /* 68 */ (95, 135, 215), |
10844 | + /* 69 */ (95, 135, 255), |
10845 | + /* 70 */ (95, 175, 0), |
10846 | + /* 71 */ (95, 175, 95), |
10847 | + /* 72 */ (95, 175, 135), |
10848 | + /* 73 */ (95, 175, 175), |
10849 | + /* 74 */ (95, 175, 215), |
10850 | + /* 75 */ (95, 175, 255), |
10851 | + /* 76 */ (95, 215, 0), |
10852 | + /* 77 */ (95, 215, 95), |
10853 | + /* 78 */ (95, 215, 135), |
10854 | + /* 79 */ (95, 215, 175), |
10855 | + /* 80 */ (95, 215, 215), |
10856 | + /* 81 */ (95, 215, 255), |
10857 | + /* 82 */ (95, 255, 0), |
10858 | + /* 83 */ (95, 255, 95), |
10859 | + /* 84 */ (95, 255, 135), |
10860 | + /* 85 */ (95, 255, 175), |
10861 | + /* 86 */ (95, 255, 215), |
10862 | + /* 87 */ (95, 255, 255), |
10863 | + /* 88 */ (135, 0, 0), |
10864 | + /* 89 */ (135, 0, 95), |
10865 | + /* 90 */ (135, 0, 135), |
10866 | + /* 91 */ (135, 0, 175), |
10867 | + /* 92 */ (135, 0, 215), |
10868 | + /* 93 */ (135, 0, 255), |
10869 | + /* 94 */ (135, 95, 0), |
10870 | + /* 95 */ (135, 95, 95), |
10871 | + /* 96 */ (135, 95, 135), |
10872 | + /* 97 */ (135, 95, 175), |
10873 | + /* 98 */ (135, 95, 215), |
10874 | + /* 99 */ (135, 95, 255), |
10875 | + /* 100 */ (135, 135, 0), |
10876 | + /* 101 */ (135, 135, 95), |
10877 | + /* 102 */ (135, 135, 135), |
10878 | + /* 103 */ (135, 135, 175), |
10879 | + /* 104 */ (135, 135, 215), |
10880 | + /* 105 */ (135, 135, 255), |
10881 | + /* 106 */ (135, 175, 0), |
10882 | + /* 107 */ (135, 175, 95), |
10883 | + /* 108 */ (135, 175, 135), |
10884 | + /* 109 */ (135, 175, 175), |
10885 | + /* 110 */ (135, 175, 215), |
10886 | + /* 111 */ (135, 175, 255), |
10887 | + /* 112 */ (135, 215, 0), |
10888 | + /* 113 */ (135, 215, 95), |
10889 | + /* 114 */ (135, 215, 135), |
10890 | + /* 115 */ (135, 215, 175), |
10891 | + /* 116 */ (135, 215, 215), |
10892 | + /* 117 */ (135, 215, 255), |
10893 | + /* 118 */ (135, 255, 0), |
10894 | + /* 119 */ (135, 255, 95), |
10895 | + /* 120 */ (135, 255, 135), |
10896 | + /* 121 */ (135, 255, 175), |
10897 | + /* 122 */ (135, 255, 215), |
10898 | + /* 123 */ (135, 255, 255), |
10899 | + /* 124 */ (175, 0, 0), |
10900 | + /* 125 */ (175, 0, 95), |
10901 | + /* 126 */ (175, 0, 135), |
10902 | + /* 127 */ (175, 0, 175), |
10903 | + /* 128 */ (175, 0, 215), |
10904 | + /* 129 */ (175, 0, 255), |
10905 | + /* 130 */ (175, 95, 0), |
10906 | + /* 131 */ (175, 95, 95), |
10907 | + /* 132 */ (175, 95, 135), |
10908 | + /* 133 */ (175, 95, 175), |
10909 | + /* 134 */ (175, 95, 215), |
10910 | + /* 135 */ (175, 95, 255), |
10911 | + /* 136 */ (175, 135, 0), |
10912 | + /* 137 */ (175, 135, 95), |
10913 | + /* 138 */ (175, 135, 135), |
10914 | + /* 139 */ (175, 135, 175), |
10915 | + /* 140 */ (175, 135, 215), |
10916 | + /* 141 */ (175, 135, 255), |
10917 | + /* 142 */ (175, 175, 0), |
10918 | + /* 143 */ (175, 175, 95), |
10919 | + /* 144 */ (175, 175, 135), |
10920 | + /* 145 */ (175, 175, 175), |
10921 | + /* 146 */ (175, 175, 215), |
10922 | + /* 147 */ (175, 175, 255), |
10923 | + /* 148 */ (175, 215, 0), |
10924 | + /* 149 */ (175, 215, 95), |
10925 | + /* 150 */ (175, 215, 135), |
10926 | + /* 151 */ (175, 215, 175), |
10927 | + /* 152 */ (175, 215, 215), |
10928 | + /* 153 */ (175, 215, 255), |
10929 | + /* 154 */ (175, 255, 0), |
10930 | + /* 155 */ (175, 255, 95), |
10931 | + /* 156 */ (175, 255, 135), |
10932 | + /* 157 */ (175, 255, 175), |
10933 | + /* 158 */ (175, 255, 215), |
10934 | + /* 159 */ (175, 255, 255), |
10935 | + /* 160 */ (215, 0, 0), |
10936 | + /* 161 */ (215, 0, 95), |
10937 | + /* 162 */ (215, 0, 135), |
10938 | + /* 163 */ (215, 0, 175), |
10939 | + /* 164 */ (215, 0, 215), |
10940 | + /* 165 */ (215, 0, 255), |
10941 | + /* 166 */ (215, 95, 0), |
10942 | + /* 167 */ (215, 95, 95), |
10943 | + /* 168 */ (215, 95, 135), |
10944 | + /* 169 */ (215, 95, 175), |
10945 | + /* 170 */ (215, 95, 215), |
10946 | + /* 171 */ (215, 95, 255), |
10947 | + /* 172 */ (215, 135, 0), |
10948 | + /* 173 */ (215, 135, 95), |
10949 | + /* 174 */ (215, 135, 135), |
10950 | + /* 175 */ (215, 135, 175), |
10951 | + /* 176 */ (215, 135, 215), |
10952 | + /* 177 */ (215, 135, 255), |
10953 | + /* 178 */ (215, 175, 0), |
10954 | + /* 179 */ (215, 175, 95), |
10955 | + /* 180 */ (215, 175, 135), |
10956 | + /* 181 */ (215, 175, 175), |
10957 | + /* 182 */ (215, 175, 215), |
10958 | + /* 183 */ (215, 175, 255), |
10959 | + /* 184 */ (215, 215, 0), |
10960 | + /* 185 */ (215, 215, 95), |
10961 | + /* 186 */ (215, 215, 135), |
10962 | + /* 187 */ (215, 215, 175), |
10963 | + /* 188 */ (215, 215, 215), |
10964 | + /* 189 */ (215, 215, 255), |
10965 | + /* 190 */ (215, 255, 0), |
10966 | + /* 191 */ (215, 255, 95), |
10967 | + /* 192 */ (215, 255, 135), |
10968 | + /* 193 */ (215, 255, 175), |
10969 | + /* 194 */ (215, 255, 215), |
10970 | + /* 195 */ (215, 255, 255), |
10971 | + /* 196 */ (255, 0, 0), |
10972 | + /* 197 */ (255, 0, 95), |
10973 | + /* 198 */ (255, 0, 135), |
10974 | + /* 199 */ (255, 0, 175), |
10975 | + /* 200 */ (255, 0, 215), |
10976 | + /* 201 */ (255, 0, 255), |
10977 | + /* 202 */ (255, 95, 0), |
10978 | + /* 203 */ (255, 95, 95), |
10979 | + /* 204 */ (255, 95, 135), |
10980 | + /* 205 */ (255, 95, 175), |
10981 | + /* 206 */ (255, 95, 215), |
10982 | + /* 207 */ (255, 95, 255), |
10983 | + /* 208 */ (255, 135, 0), |
10984 | + /* 209 */ (255, 135, 95), |
10985 | + /* 210 */ (255, 135, 135), |
10986 | + /* 211 */ (255, 135, 175), |
10987 | + /* 212 */ (255, 135, 215), |
10988 | + /* 213 */ (255, 135, 255), |
10989 | + /* 214 */ (255, 175, 0), |
10990 | + /* 215 */ (255, 175, 95), |
10991 | + /* 216 */ (255, 175, 135), |
10992 | + /* 217 */ (255, 175, 175), |
10993 | + /* 218 */ (255, 175, 215), |
10994 | + /* 219 */ (255, 175, 255), |
10995 | + /* 220 */ (255, 215, 0), |
10996 | + /* 221 */ (255, 215, 95), |
10997 | + /* 222 */ (255, 215, 135), |
10998 | + /* 223 */ (255, 215, 175), |
10999 | + /* 224 */ (255, 215, 215), |
11000 | + /* 225 */ (255, 215, 255), |
11001 | + /* 226 */ (255, 255, 0), |
11002 | + /* 227 */ (255, 255, 95), |
11003 | + /* 228 */ (255, 255, 135), |
11004 | + /* 229 */ (255, 255, 175), |
11005 | + /* 230 */ (255, 255, 215), |
11006 | + /* 231 */ (255, 255, 255), |
11007 | + /* 232 */ (8, 8, 8), |
11008 | + /* 233 */ (18, 18, 18), |
11009 | + /* 234 */ (28, 28, 28), |
11010 | + /* 235 */ (38, 38, 38), |
11011 | + /* 236 */ (48, 48, 48), |
11012 | + /* 237 */ (58, 58, 58), |
11013 | + /* 238 */ (68, 68, 68), |
11014 | + /* 239 */ (78, 78, 78), |
11015 | + /* 240 */ (88, 88, 88), |
11016 | + /* 241 */ (98, 98, 98), |
11017 | + /* 242 */ (108, 108, 108), |
11018 | + /* 243 */ (118, 118, 118), |
11019 | + /* 244 */ (128, 128, 128), |
11020 | + /* 245 */ (138, 138, 138), |
11021 | + /* 246 */ (148, 148, 148), |
11022 | + /* 247 */ (158, 158, 158), |
11023 | + /* 248 */ (168, 168, 168), |
11024 | + /* 249 */ (178, 178, 178), |
11025 | + /* 250 */ (188, 188, 188), |
11026 | + /* 251 */ (198, 198, 198), |
11027 | + /* 252 */ (208, 208, 208), |
11028 | + /* 253 */ (218, 218, 218), |
11029 | + /* 254 */ (228, 228, 228), |
11030 | + /* 255 */ (238, 238, 238), |
11031 | ]; |
11032 | diff --git a/src/components/utilities.rs b/src/components/utilities.rs |
11033 | index 848770e..b76cbac 100644 |
11034 | --- a/src/components/utilities.rs |
11035 | +++ b/src/components/utilities.rs |
11036 | @@ -21,9 +21,10 @@ |
11037 | |
11038 | /*! Various useful components that can be used in a generic fashion. |
11039 | */ |
11040 | - use super::*; |
11041 | use text_processing::Reflow; |
11042 | |
11043 | + use super::*; |
11044 | + |
11045 | mod pager; |
11046 | pub use self::pager::*; |
11047 | |
11048 | @@ -37,10 +38,10 @@ mod dialogs; |
11049 | pub use self::dialogs::*; |
11050 | |
11051 | mod tables; |
11052 | - pub use self::tables::*; |
11053 | + use std::collections::HashSet; |
11054 | |
11055 | + pub use self::tables::*; |
11056 | use crate::jobs::JobId; |
11057 | - use std::collections::HashSet; |
11058 | |
11059 | #[derive(Default, Debug, Clone)] |
11060 | pub struct SearchPattern { |
11061 | @@ -943,12 +944,13 @@ impl Component for Tabbed { |
11062 | )); |
11063 | } |
11064 | |
11065 | - /* If children are dirty but self isn't and the shortcuts panel is visible, it will get |
11066 | - * overwritten. */ |
11067 | + /* If children are dirty but self isn't and the shortcuts panel is visible, |
11068 | + * it will get overwritten. */ |
11069 | let must_redraw_shortcuts: bool = self.show_shortcuts && !self.dirty && self.is_dirty(); |
11070 | |
11071 | - /* children should be drawn after the shortcuts/help panel lest they overwrite the panel on |
11072 | - * the grid. the drawing order is determined by the dirty_areas queue which is LIFO */ |
11073 | + /* children should be drawn after the shortcuts/help panel lest they |
11074 | + * overwrite the panel on the grid. the drawing order is determined |
11075 | + * by the dirty_areas queue which is LIFO */ |
11076 | if self.children.len() > 1 { |
11077 | self.draw_tabs( |
11078 | grid, |
11079 | diff --git a/src/components/utilities/dialogs.rs b/src/components/utilities/dialogs.rs |
11080 | index 1ace1de..1086cac 100644 |
11081 | --- a/src/components/utilities/dialogs.rs |
11082 | +++ b/src/components/utilities/dialogs.rs |
11083 | @@ -40,9 +40,10 @@ enum SelectorCursor { |
11084 | |
11085 | /// Shows a little window with options for user to select. |
11086 | /// |
11087 | - /// Instantiate with Selector::new(). Set single_only to true if user should only choose one of the |
11088 | - /// options. After passing input events to this component, check Selector::is_done to see if the |
11089 | - /// user has finalised their choices. Collect the choices by consuming the Selector with |
11090 | + /// Instantiate with Selector::new(). Set single_only to true if user should |
11091 | + /// only choose one of the options. After passing input events to this |
11092 | + /// component, check Selector::is_done to see if the user has finalised their |
11093 | + /// choices. Collect the choices by consuming the Selector with |
11094 | /// Selector::collect() |
11095 | pub struct Selector<T: 'static + PartialEq + Debug + Clone + Sync + Send, F: 'static + Sync + Send> |
11096 | { |
11097 | diff --git a/src/components/utilities/pager.rs b/src/components/utilities/pager.rs |
11098 | index cbda139..6a73225 100644 |
11099 | --- a/src/components/utilities/pager.rs |
11100 | +++ b/src/components/utilities/pager.rs |
11101 | @@ -19,12 +19,14 @@ |
11102 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
11103 | */ |
11104 | |
11105 | - use super::*; |
11106 | use melib::text_processing::LineBreakText; |
11107 | |
11108 | + use super::*; |
11109 | + |
11110 | /// A pager for text. |
11111 | - /// `Pager` holds its own content in its own `CellBuffer` and when `draw` is called, it draws the |
11112 | - /// current view of the text. It is responsible for scrolling etc. |
11113 | + /// `Pager` holds its own content in its own `CellBuffer` and when `draw` is |
11114 | + /// called, it draws the current view of the text. It is responsible for |
11115 | + /// scrolling etc. |
11116 | #[derive(Default, Debug, Clone)] |
11117 | pub struct Pager { |
11118 | text: String, |
11119 | @@ -48,7 +50,7 @@ pub struct Pager { |
11120 | |
11121 | impl fmt::Display for Pager { |
11122 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
11123 | - write!(f, "{}", "pager") |
11124 | + write!(f, "pager") |
11125 | } |
11126 | } |
11127 | |
11128 | @@ -171,10 +173,12 @@ impl Pager { |
11129 | |
11130 | pub fn filter(&mut self, cmd: &str) { |
11131 | let _f = |bin: &str, text: &str| -> Result<CellBuffer> { |
11132 | - use std::io::Write; |
11133 | - use std::process::{Command, Stdio}; |
11134 | + use std::{ |
11135 | + io::Write, |
11136 | + process::{Command, Stdio}, |
11137 | + }; |
11138 | let mut filter_child = Command::new("sh") |
11139 | - .args(&["-c", bin]) |
11140 | + .args(["-c", bin]) |
11141 | .stdin(Stdio::piped()) |
11142 | .stdout(Stdio::piped()) |
11143 | .spawn() |
11144 | @@ -708,8 +712,10 @@ impl Component for Pager { |
11145 | self.dirty = true; |
11146 | } |
11147 | UIEvent::Action(View(Pipe(ref bin, ref args))) => { |
11148 | - use std::io::Write; |
11149 | - use std::process::{Command, Stdio}; |
11150 | + use std::{ |
11151 | + io::Write, |
11152 | + process::{Command, Stdio}, |
11153 | + }; |
11154 | let mut command_obj = match Command::new(bin) |
11155 | .args(args.as_slice()) |
11156 | .stdin(Stdio::piped()) |
11157 | diff --git a/src/components/utilities/tables.rs b/src/components/utilities/tables.rs |
11158 | index 25ce549..b6cdd33 100644 |
11159 | --- a/src/components/utilities/tables.rs |
11160 | +++ b/src/components/utilities/tables.rs |
11161 | @@ -20,9 +20,10 @@ |
11162 | */ |
11163 | |
11164 | /*! UI components to display tabular lists. */ |
11165 | + use std::mem::MaybeUninit; |
11166 | + |
11167 | use super::*; |
11168 | use crate::segment_tree::SegmentTree; |
11169 | - use std::mem::MaybeUninit; |
11170 | |
11171 | #[derive(Debug, Default, Copy, Clone)] |
11172 | pub enum ColumnElasticity { |
11173 | @@ -130,7 +131,8 @@ pub struct DataColumns<const N: usize> { |
11174 | pub segment_tree: Box<[SegmentTree; N]>, |
11175 | } |
11176 | |
11177 | - // Workaround because Default derive doesn't work for const generic array lengths yet. |
11178 | + // Workaround because Default derive doesn't work for const generic array |
11179 | + // lengths yet. |
11180 | impl<const N: usize> Default for DataColumns<N> { |
11181 | fn default() -> Self { |
11182 | fn init_array<T, const N: usize>(cl: impl Fn() -> T) -> [T; N] { |
11183 | diff --git a/src/components/utilities/widgets.rs b/src/components/utilities/widgets.rs |
11184 | index 682d6b1..475aad2 100644 |
11185 | --- a/src/components/utilities/widgets.rs |
11186 | +++ b/src/components/utilities/widgets.rs |
11187 | @@ -19,15 +19,15 @@ |
11188 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
11189 | */ |
11190 | |
11191 | + use std::{borrow::Cow, collections::HashMap, time::Duration}; |
11192 | + |
11193 | use super::*; |
11194 | - use std::borrow::Cow; |
11195 | - use std::collections::HashMap; |
11196 | - use std::time::Duration; |
11197 | |
11198 | type AutoCompleteFn = Box<dyn Fn(&Context, &str) -> Vec<AutoCompleteEntry> + Send + Sync>; |
11199 | |
11200 | - #[derive(Debug, PartialEq, Eq)] |
11201 | + #[derive(Debug, PartialEq, Eq, Default)] |
11202 | enum FormFocus { |
11203 | + #[default] |
11204 | Fields, |
11205 | Buttons, |
11206 | TextInput, |
11207 | @@ -35,12 +35,6 @@ enum FormFocus { |
11208 | |
11209 | type Cursor = usize; |
11210 | |
11211 | - impl Default for FormFocus { |
11212 | - fn default() -> FormFocus { |
11213 | - FormFocus::Fields |
11214 | - } |
11215 | - } |
11216 | - |
11217 | pub enum Field { |
11218 | Text(UText, Option<(AutoCompleteFn, Box<AutoComplete>)>), |
11219 | Choice(Vec<Cow<'static, str>>, Cursor), |
11220 | @@ -149,8 +143,8 @@ impl Component for Field { |
11221 | * ########################################## |
11222 | * |
11223 | * Example: |
11224 | - * For the string "The quick brown fox jumps over the lazy dog" with visible width |
11225 | - * of field of 10 columns |
11226 | + * For the string "The quick brown fox jumps over the lazy dog" with visible |
11227 | + * width of field of 10 columns |
11228 | * |
11229 | * |
11230 | * Cursor <= width |
11231 | @@ -390,20 +384,15 @@ impl fmt::Display for Field { |
11232 | } |
11233 | } |
11234 | |
11235 | - #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
11236 | + #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] |
11237 | pub enum FormButtonActions { |
11238 | Accept, |
11239 | Reset, |
11240 | + #[default] |
11241 | Cancel, |
11242 | Other(&'static str), |
11243 | } |
11244 | |
11245 | - impl Default for FormButtonActions { |
11246 | - fn default() -> Self { |
11247 | - FormButtonActions::Cancel |
11248 | - } |
11249 | - } |
11250 | - |
11251 | #[derive(Debug, Default)] |
11252 | pub struct FormWidget<T> |
11253 | where |
11254 | diff --git a/src/conf.rs b/src/conf.rs |
11255 | index eaff868..196718e 100644 |
11256 | --- a/src/conf.rs |
11257 | +++ b/src/conf.rs |
11258 | @@ -26,14 +26,17 @@ extern crate serde; |
11259 | extern crate toml; |
11260 | extern crate xdg; |
11261 | |
11262 | - use crate::conf::deserializers::non_empty_string; |
11263 | - use crate::terminal::Color; |
11264 | - use melib::backends::TagHash; |
11265 | - use melib::search::Query; |
11266 | - use std::collections::HashSet; |
11267 | - use std::io::Read; |
11268 | - use std::process::{Command, Stdio}; |
11269 | + use std::{ |
11270 | + collections::HashSet, |
11271 | + io::Read, |
11272 | + process::{Command, Stdio}, |
11273 | + }; |
11274 | |
11275 | + use melib::{backends::TagHash, search::Query}; |
11276 | + |
11277 | + use crate::{conf::deserializers::non_empty_string, terminal::Color}; |
11278 | + |
11279 | + #[rustfmt::skip] |
11280 | mod overrides; |
11281 | pub use overrides::*; |
11282 | pub mod composing; |
11283 | @@ -49,30 +52,29 @@ mod themes; |
11284 | pub use themes::*; |
11285 | |
11286 | pub mod accounts; |
11287 | - pub use self::accounts::Account; |
11288 | - pub use self::composing::*; |
11289 | - pub use self::pgp::*; |
11290 | - pub use self::shortcuts::*; |
11291 | - pub use self::tags::*; |
11292 | - pub use melib::thread::{SortField, SortOrder}; |
11293 | - |
11294 | - use self::default_vals::*; |
11295 | - use self::listing::ListingSettings; |
11296 | - use self::notifications::NotificationsSettings; |
11297 | - use self::terminal::TerminalSettings; |
11298 | - use crate::pager::PagerSettings; |
11299 | - use melib::conf::{AccountSettings, MailboxConf, ToggleFlag}; |
11300 | - use melib::error::*; |
11301 | + use std::{ |
11302 | + collections::HashMap, |
11303 | + env, |
11304 | + fs::OpenOptions, |
11305 | + io::{self, BufRead, Write}, |
11306 | + os::unix::fs::PermissionsExt, |
11307 | + path::{Path, PathBuf}, |
11308 | + }; |
11309 | |
11310 | + use indexmap::IndexMap; |
11311 | + pub use melib::thread::{SortField, SortOrder}; |
11312 | + use melib::{ |
11313 | + conf::{AccountSettings, MailboxConf, ToggleFlag}, |
11314 | + error::*, |
11315 | + }; |
11316 | use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; |
11317 | |
11318 | - use indexmap::IndexMap; |
11319 | - use std::collections::HashMap; |
11320 | - use std::env; |
11321 | - use std::fs::OpenOptions; |
11322 | - use std::io::{self, BufRead, Write}; |
11323 | - use std::os::unix::fs::PermissionsExt; |
11324 | - use std::path::{Path, PathBuf}; |
11325 | + pub use self::{accounts::Account, composing::*, pgp::*, shortcuts::*, tags::*}; |
11326 | + use self::{ |
11327 | + default_vals::*, listing::ListingSettings, notifications::NotificationsSettings, |
11328 | + terminal::TerminalSettings, |
11329 | + }; |
11330 | + use crate::pager::PagerSettings; |
11331 | |
11332 | #[macro_export] |
11333 | macro_rules! split_command { |
11334 | @@ -185,7 +187,8 @@ pub struct FileAccount { |
11335 | pub conf_override: MailUIConf, |
11336 | #[serde(flatten)] |
11337 | #[serde(deserialize_with = "extra_settings")] |
11338 | - pub extra: IndexMap<String, String>, /* use custom deserializer to convert any given value (eg bool, number, etc) to string */ |
11339 | + pub extra: IndexMap<String, String>, /* use custom deserializer to convert any given value |
11340 | + * (eg bool, number, etc) to string */ |
11341 | } |
11342 | |
11343 | impl FileAccount { |
11344 | @@ -381,7 +384,7 @@ define(`include', `builtin_include(substr($1,1,decr(decr(len($1)))))dnl')dnl |
11345 | file.read_to_string(&mut contents)?; |
11346 | |
11347 | let mut handle = Command::new("m4") |
11348 | - .current_dir(conf_path.parent().unwrap_or(&Path::new("/"))) |
11349 | + .current_dir(conf_path.parent().unwrap_or(Path::new("/"))) |
11350 | .stdin(Stdio::piped()) |
11351 | .stdout(Stdio::piped()) |
11352 | .stderr(Stdio::piped()) |
11353 | @@ -390,7 +393,7 @@ define(`include', `builtin_include(substr($1,1,decr(decr(len($1)))))dnl')dnl |
11354 | stdin.write_all(M4_PREAMBLE.as_bytes())?; |
11355 | stdin.write_all(contents.as_bytes())?; |
11356 | drop(stdin); |
11357 | - let stdout = handle.wait_with_output()?.stdout.clone(); |
11358 | + let stdout = handle.wait_with_output()?.stdout; |
11359 | Ok(String::from_utf8_lossy(&stdout).to_string()) |
11360 | } |
11361 | |
11362 | @@ -452,6 +455,7 @@ impl FileSettings { |
11363 | } |
11364 | #[cfg(test)] |
11365 | return Ok(FileSettings::default()); |
11366 | + #[cfg(not(test))] |
11367 | return Err(Error::new("No configuration file found.")); |
11368 | } |
11369 | |
11370 | @@ -469,8 +473,8 @@ impl FileSettings { |
11371 | )) |
11372 | })?; |
11373 | /* |
11374 | - * Check that a global composing option is set and return a user-friendly error message because the |
11375 | - * default serde one is confusing. |
11376 | + * Check that a global composing option is set and return a user-friendly |
11377 | + * error message because the default serde one is confusing. |
11378 | */ |
11379 | if !map.contains_key("composing") { |
11380 | let err_msg = r#"You must set a global `composing` option. If you override `composing` in each account, you can use a dummy global like follows: |
11381 | @@ -483,9 +487,10 @@ This is required so that you don't accidentally start meli and find out later th |
11382 | println!("{}", err_msg); |
11383 | let ask = Ask { |
11384 | message: format!( |
11385 | - "Would you like to append this dummy value in your configuration file {} and continue?", |
11386 | - path.display() |
11387 | - ) |
11388 | + "Would you like to append this dummy value in your configuration file {} \ |
11389 | + and continue?", |
11390 | + path.display() |
11391 | + ), |
11392 | }; |
11393 | if ask.run() { |
11394 | let mut file = OpenOptions::new().append(true).open(&path)?; |
11395 | @@ -664,20 +669,15 @@ impl Settings { |
11396 | } |
11397 | } |
11398 | |
11399 | - #[derive(Copy, Debug, Clone, Hash, PartialEq, Eq)] |
11400 | + #[derive(Copy, Debug, Clone, Hash, PartialEq, Eq, Default)] |
11401 | pub enum IndexStyle { |
11402 | Plain, |
11403 | Threaded, |
11404 | + #[default] |
11405 | Compact, |
11406 | Conversations, |
11407 | } |
11408 | |
11409 | - impl Default for IndexStyle { |
11410 | - fn default() -> Self { |
11411 | - IndexStyle::Compact |
11412 | - } |
11413 | - } |
11414 | - |
11415 | /* |
11416 | * Deserialize default functions |
11417 | */ |
11418 | @@ -753,9 +753,9 @@ mod deserializers { |
11419 | where |
11420 | D: Deserializer<'de>, |
11421 | { |
11422 | - /* Why is this needed? If the user gives a configuration value such as key = true, the |
11423 | - * parsing will fail since it expects string values. We want to accept key = true as well |
11424 | - * as key = "true". */ |
11425 | + /* Why is this needed? If the user gives a configuration value such as key = |
11426 | + * true, the parsing will fail since it expects string values. We |
11427 | + * want to accept key = true as well as key = "true". */ |
11428 | #[derive(Deserialize)] |
11429 | struct Wrapper(#[serde(deserialize_with = "any_of")] String); |
11430 | |
11431 | @@ -794,20 +794,15 @@ impl Serialize for IndexStyle { |
11432 | } |
11433 | } |
11434 | |
11435 | - #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
11436 | + #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] |
11437 | pub enum SearchBackend { |
11438 | None, |
11439 | + #[default] |
11440 | Auto, |
11441 | #[cfg(feature = "sqlite3")] |
11442 | Sqlite3, |
11443 | } |
11444 | |
11445 | - impl Default for SearchBackend { |
11446 | - fn default() -> Self { |
11447 | - SearchBackend::Auto |
11448 | - } |
11449 | - } |
11450 | - |
11451 | impl<'de> Deserialize<'de> for SearchBackend { |
11452 | fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error> |
11453 | where |
11454 | @@ -878,13 +873,16 @@ pub fn create_config_file(p: &Path) -> Result<()> { |
11455 | |
11456 | mod pp { |
11457 | //! Preprocess configuration files by unfolding `include` macros. |
11458 | + use std::{ |
11459 | + io::Read, |
11460 | + path::{Path, PathBuf}, |
11461 | + }; |
11462 | + |
11463 | use melib::{ |
11464 | error::{Error, Result}, |
11465 | parsec::*, |
11466 | ShellExpandTrait, |
11467 | }; |
11468 | - use std::io::Read; |
11469 | - use std::path::{Path, PathBuf}; |
11470 | |
11471 | /// Try to parse line into a path to be included. |
11472 | fn include_directive<'a>() -> impl Parser<'a, Option<&'a str>> { |
11473 | @@ -946,7 +944,11 @@ mod pp { |
11474 | /// Expands `include` macros in path. |
11475 | fn pp_helper(path: &Path, level: u8) -> Result<String> { |
11476 | if level > 7 { |
11477 | - return Err(Error::new(format!("Maximum recursion limit reached while unfolding include directives in {}. Have you included a config file within itself?", path.display()))); |
11478 | + return Err(Error::new(format!( |
11479 | + "Maximum recursion limit reached while unfolding include directives in {}. Have \ |
11480 | + you included a config file within itself?", |
11481 | + path.display() |
11482 | + ))); |
11483 | } |
11484 | let mut contents = String::new(); |
11485 | let mut file = std::fs::File::open(path)?; |
11486 | @@ -956,14 +958,15 @@ mod pp { |
11487 | for (i, l) in contents.lines().enumerate() { |
11488 | if let (_, Some(sub_path)) = include_directive().parse(l).map_err(|l| { |
11489 | Error::new(format!( |
11490 | - "Malformed include directive in line {} of file {}: {}\nConfiguration uses the standard m4 macro include(\"filename\").", |
11491 | + "Malformed include directive in line {} of file {}: {}\nConfiguration uses \ |
11492 | + the standard m4 macro include(\"filename\").", |
11493 | i, |
11494 | path.display(), |
11495 | l |
11496 | )) |
11497 | })? { |
11498 | let mut p = Path::new(sub_path).expand(); |
11499 | - if p.is_relative() { |
11500 | + if p.is_relative() { |
11501 | /* We checked that path is ok above so we can do unwrap here */ |
11502 | let prefix = path.parent().unwrap(); |
11503 | p = prefix.join(p) |
11504 | @@ -979,8 +982,8 @@ mod pp { |
11505 | Ok(ret) |
11506 | } |
11507 | |
11508 | - /// Expands `include` macros in configuration file and other configuration files (eg. themes) |
11509 | - /// in the filesystem. |
11510 | + /// Expands `include` macros in configuration file and other configuration |
11511 | + /// files (eg. themes) in the filesystem. |
11512 | pub fn pp<P: AsRef<Path>>(path: P) -> Result<String> { |
11513 | let p_buf: PathBuf = if path.as_ref().is_relative() { |
11514 | path.as_ref().expand().canonicalize()? |
11515 | @@ -1137,14 +1140,22 @@ mod dotaddressable { |
11516 | Some(field) => { |
11517 | let _tail = &path[1..]; |
11518 | match *field { |
11519 | - "pager" => Err(Error::new("unimplemented")), //self.pager.lookup(field, tail), |
11520 | - "listing" => Err(Error::new("unimplemented")), // self.listing.lookup(field, tail), |
11521 | - "notifications" => Err(Error::new("unimplemented")), // self.notifications.lookup(field, tail), |
11522 | - "shortcuts" => Err(Error::new("unimplemented")), //self.shortcuts.lookup(field, tail), |
11523 | - "composing" => Err(Error::new("unimplemented")), //self.composing.lookup(field, tail), |
11524 | - "identity" => Err(Error::new("unimplemented")), //self.identity.lookup(field, tail)<String>, |
11525 | - "tags" => Err(Error::new("unimplemented")), //self.tags.lookup(field, tail), |
11526 | - "themes" => Err(Error::new("unimplemented")), //self.themes.lookup(field, tail)<Themes>, |
11527 | + "pager" => Err(Error::new("unimplemented")), /* self.pager.lookup(field, */ |
11528 | + // tail), |
11529 | + "listing" => Err(Error::new("unimplemented")), /* self.listing.lookup(field, tail), */ |
11530 | + "notifications" => Err(Error::new("unimplemented")), /* self.notifications.lookup(field, tail), */ |
11531 | + "shortcuts" => Err(Error::new("unimplemented")), /* self.shortcuts. */ |
11532 | + // lookup(field, |
11533 | + // tail), |
11534 | + "composing" => Err(Error::new("unimplemented")), /* self.composing.lookup(field, tail), */ |
11535 | + "identity" => Err(Error::new("unimplemented")), /* self.identity. */ |
11536 | + // lookup(field, |
11537 | + // tail)<String>, |
11538 | + "tags" => Err(Error::new("unimplemented")), /* self.tags.lookup(field, */ |
11539 | + // tail), |
11540 | + "themes" => Err(Error::new("unimplemented")), /* self.themes. */ |
11541 | + // lookup(field, |
11542 | + // tail)<Themes>, |
11543 | "pgp" => Err(Error::new("unimplemented")), //self.pgp.lookup(field, tail), |
11544 | |
11545 | other => Err(Error::new(format!( |
11546 | @@ -1260,10 +1271,7 @@ mod dotaddressable { |
11547 | |
11548 | #[test] |
11549 | fn test_config_parse() { |
11550 | - use std::fmt::Write; |
11551 | - use std::fs; |
11552 | - use std::io::prelude::*; |
11553 | - use std::path::PathBuf; |
11554 | + use std::{fmt::Write, fs, io::prelude::*, path::PathBuf}; |
11555 | |
11556 | struct ConfigFile { |
11557 | path: PathBuf, |
11558 | @@ -1346,13 +1354,20 @@ send_mail = 'false' |
11559 | |
11560 | let mut new_file = ConfigFile::new(TEST_CONFIG).unwrap(); |
11561 | let err = FileSettings::validate(new_file.path.clone(), false, true).unwrap_err(); |
11562 | - assert!(err.summary.as_ref().starts_with("You must set a global `composing` option. If you override `composing` in each account, you can use a dummy global like follows")); |
11563 | + assert!(err.summary.as_ref().starts_with( |
11564 | + "You must set a global `composing` option. If you override `composing` in each account, \ |
11565 | + you can use a dummy global like follows" |
11566 | + )); |
11567 | new_file |
11568 | .file |
11569 | .write_all("[composing]\nsend_mail = 'false'\n".as_bytes()) |
11570 | .unwrap(); |
11571 | let err = FileSettings::validate(new_file.path.clone(), false, true).unwrap_err(); |
11572 | - assert_eq!(err.summary.as_ref(), "Configuration error (account-name): root_mailbox `/path/to/root/mailbox` is not a valid directory."); |
11573 | + assert_eq!( |
11574 | + err.summary.as_ref(), |
11575 | + "Configuration error (account-name): root_mailbox `/path/to/root/mailbox` is not a valid \ |
11576 | + directory." |
11577 | + ); |
11578 | |
11579 | /* Test unrecognised configuration entries error */ |
11580 | |
11581 | diff --git a/src/conf/accounts.rs b/src/conf/accounts.rs |
11582 | index 305f570..05b24e0 100644 |
11583 | --- a/src/conf/accounts.rs |
11584 | +++ b/src/conf/accounts.rs |
11585 | @@ -23,38 +23,42 @@ |
11586 | * Account management from user configuration. |
11587 | */ |
11588 | |
11589 | - use super::{AccountConf, FileMailboxConf}; |
11590 | - use crate::jobs::{JobExecutor, JobId, JoinHandle}; |
11591 | - use indexmap::IndexMap; |
11592 | - use melib::backends::*; |
11593 | - use melib::email::*; |
11594 | - use melib::error::{Error, ErrorKind, Result}; |
11595 | - use melib::text_processing::GlobMatch; |
11596 | - use melib::thread::{SortField, SortOrder, Threads}; |
11597 | - use melib::AddressBook; |
11598 | - use melib::Collection; |
11599 | - use smallvec::SmallVec; |
11600 | - use std::collections::BTreeMap; |
11601 | - use std::collections::{HashMap, HashSet}; |
11602 | + use std::{ |
11603 | + borrow::Cow, |
11604 | + collections::{BTreeMap, HashMap, HashSet, VecDeque}, |
11605 | + convert::TryFrom, |
11606 | + fs, |
11607 | + future::Future, |
11608 | + io, |
11609 | + ops::{Index, IndexMut}, |
11610 | + os::unix::fs::PermissionsExt, |
11611 | + pin::Pin, |
11612 | + result, |
11613 | + sync::{Arc, RwLock}, |
11614 | + }; |
11615 | |
11616 | - use crate::types::UIEvent::{self, EnvelopeRemove, EnvelopeRename, EnvelopeUpdate, Notification}; |
11617 | - use crate::{StatusEvent, ThreadEvent}; |
11618 | use crossbeam::channel::Sender; |
11619 | use futures::{ |
11620 | future::FutureExt, |
11621 | stream::{Stream, StreamExt}, |
11622 | }; |
11623 | - use std::borrow::Cow; |
11624 | - use std::collections::VecDeque; |
11625 | - use std::convert::TryFrom; |
11626 | - use std::fs; |
11627 | - use std::future::Future; |
11628 | - use std::io; |
11629 | - use std::ops::{Index, IndexMut}; |
11630 | - use std::os::unix::fs::PermissionsExt; |
11631 | - use std::pin::Pin; |
11632 | - use std::result; |
11633 | - use std::sync::{Arc, RwLock}; |
11634 | + use indexmap::IndexMap; |
11635 | + use melib::{ |
11636 | + backends::*, |
11637 | + email::*, |
11638 | + error::{Error, ErrorKind, Result}, |
11639 | + text_processing::GlobMatch, |
11640 | + thread::{SortField, SortOrder, Threads}, |
11641 | + AddressBook, Collection, |
11642 | + }; |
11643 | + use smallvec::SmallVec; |
11644 | + |
11645 | + use super::{AccountConf, FileMailboxConf}; |
11646 | + use crate::{ |
11647 | + jobs::{JobExecutor, JobId, JoinHandle}, |
11648 | + types::UIEvent::{self, EnvelopeRemove, EnvelopeRename, EnvelopeUpdate, Notification}, |
11649 | + StatusEvent, ThreadEvent, |
11650 | + }; |
11651 | |
11652 | #[macro_export] |
11653 | macro_rules! try_recv_timeout { |
11654 | @@ -72,21 +76,16 @@ macro_rules! try_recv_timeout { |
11655 | }}; |
11656 | } |
11657 | |
11658 | - #[derive(Debug, Clone)] |
11659 | + #[derive(Debug, Clone, Default)] |
11660 | pub enum MailboxStatus { |
11661 | Available, |
11662 | Failed(Error), |
11663 | /// first argument is done work, and second is total work |
11664 | Parsing(usize, usize), |
11665 | + #[default] |
11666 | None, |
11667 | } |
11668 | |
11669 | - impl Default for MailboxStatus { |
11670 | - fn default() -> Self { |
11671 | - MailboxStatus::None |
11672 | - } |
11673 | - } |
11674 | - |
11675 | impl MailboxStatus { |
11676 | pub fn is_available(&self) -> bool { |
11677 | matches!(self, MailboxStatus::Available) |
11678 | @@ -512,7 +511,11 @@ impl Account { |
11679 | Err(err) => { |
11680 | sender |
11681 | .send(ThreadEvent::UIEvent(UIEvent::StatusEvent( |
11682 | - StatusEvent::DisplayMessage(format!("Error with setting up an sqlite3 search database for account `{}`: {}", name, err)) |
11683 | + StatusEvent::DisplayMessage(format!( |
11684 | + "Error with setting up an sqlite3 search database for account \ |
11685 | + `{}`: {}", |
11686 | + name, err |
11687 | + )), |
11688 | ))) |
11689 | .unwrap(); |
11690 | None |
11691 | @@ -523,7 +526,11 @@ impl Account { |
11692 | if !db_path.exists() { |
11693 | sender |
11694 | .send(ThreadEvent::UIEvent(UIEvent::StatusEvent( |
11695 | - StatusEvent::DisplayMessage(format!("An sqlite3 search database for account `{}` seems to be missing, a new one must be created with the `reindex` command.", name)) |
11696 | + StatusEvent::DisplayMessage(format!( |
11697 | + "An sqlite3 search database for account `{}` seems to be missing, \ |
11698 | + a new one must be created with the `reindex` command.", |
11699 | + name |
11700 | + )), |
11701 | ))) |
11702 | .unwrap(); |
11703 | } |
11704 | @@ -563,9 +570,10 @@ impl Account { |
11705 | |
11706 | let mut sent_mailbox = None; |
11707 | |
11708 | - /* Keep track of which mailbox config values we encounter in the actual mailboxes returned |
11709 | - * by the backend. For each of the actual mailboxes, delete the key from the hash set. If |
11710 | - * any are left, they are misconfigurations (eg misspelling) and a warning is shown to the |
11711 | + /* Keep track of which mailbox config values we encounter in the actual |
11712 | + * mailboxes returned by the backend. For each of the actual |
11713 | + * mailboxes, delete the key from the hash set. If any are left, they |
11714 | + * are misconfigurations (eg misspelling) and a warning is shown to the |
11715 | * user */ |
11716 | let mut mailbox_conf_hash_set = self |
11717 | .settings |
11718 | @@ -630,17 +638,19 @@ impl Account { |
11719 | for missing_mailbox in &mailbox_conf_hash_set { |
11720 | melib::log( |
11721 | format!( |
11722 | - "Account `{}` mailbox `{}` configured but not present in account's mailboxes. Is it misspelled?", |
11723 | + "Account `{}` mailbox `{}` configured but not present in account's mailboxes. \ |
11724 | + Is it misspelled?", |
11725 | &self.name, missing_mailbox, |
11726 | ), |
11727 | melib::WARN, |
11728 | ); |
11729 | self.sender |
11730 | .send(ThreadEvent::UIEvent(UIEvent::StatusEvent( |
11731 | - StatusEvent::DisplayMessage(format!( |
11732 | - "Account `{}` mailbox `{}` configured but not present in account's mailboxes. Is it misspelled?", |
11733 | - &self.name, missing_mailbox, |
11734 | - )), |
11735 | + StatusEvent::DisplayMessage(format!( |
11736 | + "Account `{}` mailbox `{}` configured but not present in account's \ |
11737 | + mailboxes. Is it misspelled?", |
11738 | + &self.name, missing_mailbox, |
11739 | + )), |
11740 | ))) |
11741 | .unwrap(); |
11742 | } |
11743 | @@ -732,7 +742,8 @@ impl Account { |
11744 | } |
11745 | |
11746 | { |
11747 | - //let mailbox: &mut Mailbox = self.mailboxes[idx].as_mut().unwrap().as_mut().unwrap(); |
11748 | + //let mailbox: &mut Mailbox = |
11749 | + // self.mailboxes[idx].as_mut().unwrap().as_mut().unwrap(); |
11750 | match event.kind { |
11751 | RefreshEventKind::Update(old_hash, envelope) => { |
11752 | if !self.collection.contains_key(&old_hash) { |
11753 | @@ -1056,7 +1067,7 @@ impl Account { |
11754 | pub fn refresh(&mut self, mailbox_hash: MailboxHash) -> Result<()> { |
11755 | if let Some(ref refresh_command) = self.settings.conf().refresh_command { |
11756 | let child = std::process::Command::new("sh") |
11757 | - .args(&["-c", refresh_command]) |
11758 | + .args(["-c", refresh_command]) |
11759 | .stdin(std::process::Stdio::null()) |
11760 | .stdout(std::process::Stdio::null()) |
11761 | .stderr(std::process::Stdio::piped()) |
11762 | @@ -1297,9 +1308,12 @@ impl Account { |
11763 | send_mail: crate::conf::composing::SendMail, |
11764 | complete_in_background: bool, |
11765 | ) -> Result<Option<JoinHandle<Result<()>>>> { |
11766 | + use std::{ |
11767 | + io::Write, |
11768 | + process::{Command, Stdio}, |
11769 | + }; |
11770 | + |
11771 | use crate::conf::composing::SendMail; |
11772 | - use std::io::Write; |
11773 | - use std::process::{Command, Stdio}; |
11774 | debug!(&send_mail); |
11775 | match send_mail { |
11776 | SendMail::ShellCommand(ref command) => { |
11777 | @@ -1309,7 +1323,7 @@ impl Account { |
11778 | )); |
11779 | } |
11780 | let mut msmtp = Command::new("sh") |
11781 | - .args(&["-c", command]) |
11782 | + .args(["-c", command]) |
11783 | .stdin(Stdio::piped()) |
11784 | .stdout(Stdio::piped()) |
11785 | .spawn() |
11786 | @@ -1385,9 +1399,12 @@ impl Account { |
11787 | let backend = self.backend.clone(); |
11788 | |message: Arc<String>| -> Pin<Box<dyn Future<Output = Result<()>> + Send>> { |
11789 | Box::pin(async move { |
11790 | + use std::{ |
11791 | + io::Write, |
11792 | + process::{Command, Stdio}, |
11793 | + }; |
11794 | + |
11795 | use crate::conf::composing::SendMail; |
11796 | - use std::io::Write; |
11797 | - use std::process::{Command, Stdio}; |
11798 | match send_mail { |
11799 | SendMail::ShellCommand(ref command) => { |
11800 | if command.is_empty() { |
11801 | @@ -1396,7 +1413,7 @@ impl Account { |
11802 | )); |
11803 | } |
11804 | let mut msmtp = Command::new("sh") |
11805 | - .args(&["-c", command]) |
11806 | + .args(["-c", command]) |
11807 | .stdin(Stdio::piped()) |
11808 | .stdout(Stdio::piped()) |
11809 | .spawn() |
11810 | @@ -1418,9 +1435,10 @@ impl Account { |
11811 | ) |
11812 | } else { |
11813 | format!( |
11814 | - "Could not send e-mail using `{}`: Process was killed by signal", |
11815 | - command |
11816 | - ) |
11817 | + "Could not send e-mail using `{}`: Process was killed by \ |
11818 | + signal", |
11819 | + command |
11820 | + ) |
11821 | }; |
11822 | melib::log(&error_message, melib::LoggingLevel::ERROR); |
11823 | return Err(Error::new(error_message).set_summary("Message not sent.")); |
11824 | @@ -1566,8 +1584,8 @@ impl Account { |
11825 | ret.as_ref().map(|ret| ret.1.ref_mailbox.hash()) |
11826 | } |
11827 | |
11828 | - /* Call only in Context::is_online, since only Context can launch the watcher threads if an |
11829 | - * account goes from offline to online. */ |
11830 | + /* Call only in Context::is_online, since only Context can launch the watcher |
11831 | + * threads if an account goes from offline to online. */ |
11832 | pub fn is_online(&mut self) -> Result<()> { |
11833 | if !self.backend_capabilities.is_remote && !self.backend_capabilities.is_async { |
11834 | return Ok(()); |
11835 | @@ -1967,7 +1985,8 @@ impl Account { |
11836 | } |
11837 | tmp |
11838 | }; |
11839 | - /* if new mailbox has parent, we need to update its children field */ |
11840 | + /* if new mailbox has parent, we need to update its children |
11841 | + * field */ |
11842 | if let Some(parent_hash) = mailboxes[&mailbox_hash].parent() { |
11843 | self.mailbox_entries |
11844 | .entry(parent_hash) |
11845 | @@ -2002,7 +2021,8 @@ impl Account { |
11846 | &self.mailbox_entries, |
11847 | &mut self.mailboxes_order, |
11848 | ); |
11849 | - //Ok(format!("`{}` successfully created.", &path)) |
11850 | + //Ok(format!("`{}` successfully created.", |
11851 | + // &path)) |
11852 | } |
11853 | } |
11854 | } |
11855 | @@ -2050,7 +2070,8 @@ impl Account { |
11856 | .remove(&mailbox_hash); |
11857 | let deleted_mailbox = |
11858 | self.mailbox_entries.remove(&mailbox_hash).unwrap(); |
11859 | - /* if deleted mailbox had parent, we need to update its children field */ |
11860 | + /* if deleted mailbox had parent, we need to update its children |
11861 | + * field */ |
11862 | if let Some(parent_hash) = deleted_mailbox.ref_mailbox.parent() { |
11863 | self.mailbox_entries |
11864 | .entry(parent_hash) |
11865 | @@ -2392,7 +2413,7 @@ fn build_mailboxes_order( |
11866 | } |
11867 | while let Some(i) = iter.next() { |
11868 | let c = &mut node.children[i]; |
11869 | - rec(c, mailbox_entries, indentation, iter.peek() != None); |
11870 | + rec(c, mailbox_entries, indentation, iter.peek().is_some()); |
11871 | } |
11872 | } |
11873 | |
11874 | diff --git a/src/conf/composing.rs b/src/conf/composing.rs |
11875 | index 8bbd9c7..5c477d7 100644 |
11876 | --- a/src/conf/composing.rs |
11877 | +++ b/src/conf/composing.rs |
11878 | @@ -20,10 +20,12 @@ |
11879 | */ |
11880 | |
11881 | //! Configuration for composing email. |
11882 | - use super::default_vals::{ask, false_val, none, true_val}; |
11883 | - use melib::ToggleFlag; |
11884 | use std::collections::HashMap; |
11885 | |
11886 | + use melib::ToggleFlag; |
11887 | + |
11888 | + use super::default_vals::{ask, false_val, none, true_val}; |
11889 | + |
11890 | /// Settings for writing and sending new e-mail |
11891 | #[derive(Debug, Serialize, Deserialize, Clone)] |
11892 | #[serde(deny_unknown_fields)] |
11893 | @@ -31,7 +33,9 @@ pub struct ComposingSettings { |
11894 | /// A command to pipe new emails to |
11895 | /// Required |
11896 | pub send_mail: SendMail, |
11897 | - /// Command to launch editor. Can have arguments. Draft filename is given as the last argument. If it's missing, the environment variable $EDITOR is looked up. |
11898 | + /// Command to launch editor. Can have arguments. Draft filename is given as |
11899 | + /// the last argument. If it's missing, the environment variable $EDITOR is |
11900 | + /// looked up. |
11901 | #[serde( |
11902 | default = "none", |
11903 | alias = "editor-command", |
11904 | @@ -54,15 +58,16 @@ pub struct ComposingSettings { |
11905 | /// Default: empty |
11906 | #[serde(default, alias = "default-header-values")] |
11907 | pub default_header_values: HashMap<String, String>, |
11908 | - /// Wrap header preample when editing a draft in an editor. This allows you to write non-plain |
11909 | - /// text email without the preamble creating syntax errors. They are stripped when you return |
11910 | - /// from the editor. The values should be a two element array of strings, a prefix and suffix. |
11911 | + /// Wrap header preample when editing a draft in an editor. This allows you |
11912 | + /// to write non-plain text email without the preamble creating syntax |
11913 | + /// errors. They are stripped when you return from the editor. The |
11914 | + /// values should be a two element array of strings, a prefix and suffix. |
11915 | /// Default: None |
11916 | #[serde(default, alias = "wrap-header-preample")] |
11917 | pub wrap_header_preamble: Option<(String, String)>, |
11918 | - /// Store sent mail after successful submission. This setting is meant to be disabled for |
11919 | - /// non-standard behaviour in gmail, which auto-saves sent mail on its own. |
11920 | - /// Default: true |
11921 | + /// Store sent mail after successful submission. This setting is meant to be |
11922 | + /// disabled for non-standard behaviour in gmail, which auto-saves sent |
11923 | + /// mail on its own. Default: true |
11924 | #[serde(default = "true_val")] |
11925 | pub store_sent_mail: bool, |
11926 | /// The attribution line appears above the quoted reply text. |
11927 | @@ -70,12 +75,12 @@ pub struct ComposingSettings { |
11928 | /// - `%+f` — the sender's name and email address. |
11929 | /// - `%+n` — the sender's name (or email address, if no name is included). |
11930 | /// - `%+a` — the sender's email address. |
11931 | - /// The format string is passed to strftime(3) with the replied envelope's date. |
11932 | - /// Default: "On %a, %0e %b %Y %H:%M, %+f wrote:%n" |
11933 | + /// The format string is passed to strftime(3) with the replied envelope's |
11934 | + /// date. Default: "On %a, %0e %b %Y %H:%M, %+f wrote:%n" |
11935 | #[serde(default = "none")] |
11936 | pub attribution_format_string: Option<String>, |
11937 | - /// Whether the strftime call for the attribution string uses the POSIX locale instead of |
11938 | - /// the user's active locale |
11939 | + /// Whether the strftime call for the attribution string uses the POSIX |
11940 | + /// locale instead of the user's active locale |
11941 | /// Default: true |
11942 | #[serde(default = "true_val")] |
11943 | pub attribution_use_posix_locale: bool, |
11944 | @@ -84,7 +89,12 @@ pub struct ComposingSettings { |
11945 | #[serde(default = "ask", alias = "forward-as-attachment")] |
11946 | pub forward_as_attachment: ToggleFlag, |
11947 | /// Alternative lists of reply prefixes (etc. ["Re:", "RE:", ...]) to strip |
11948 | - /// Default: `["Re:", "RE:", "Fwd:", "Fw:", "回复:", "回覆:", "SV:", "Sv:", "VS:", "Antw:", "Doorst:", "VS:", "VL:", "REF:", "TR:", "TR:", "AW:", "WG:", "ΑΠ:", "Απ:", "απ:", "ΠΡΘ:", "Πρθ:", "πρθ:", "ΣΧΕΤ:", "Σχετ:", "σχετ:", "ΠΡΘ:", "Πρθ:", "πρθ:", "Vá:", "Továbbítás:", "R:", "I:", "RIF:", "FS:", "BLS:", "TRS:", "VS:", "VB:", "RV:", "RES:", "Res", "ENC:", "Odp:", "PD:", "YNT:", "İLT:", "ATB:", "YML:"]` |
11949 | + /// Default: `["Re:", "RE:", "Fwd:", "Fw:", "回复:", "回覆:", "SV:", "Sv:", |
11950 | + /// "VS:", "Antw:", "Doorst:", "VS:", "VL:", "REF:", "TR:", "TR:", "AW:", |
11951 | + /// "WG:", "ΑΠ:", "Απ:", "απ:", "ΠΡΘ:", "Πρθ:", "πρθ:", "ΣΧΕΤ:", "Σχετ:", |
11952 | + /// "σχετ:", "ΠΡΘ:", "Πρθ:", "πρθ:", "Vá:", "Továbbítás:", "R:", "I:", |
11953 | + /// "RIF:", "FS:", "BLS:", "TRS:", "VS:", "VB:", "RV:", "RES:", "Res", |
11954 | + /// "ENC:", "Odp:", "PD:", "YNT:", "İLT:", "ATB:", "YML:"]` |
11955 | #[serde(default, alias = "reply-prefix-list-to-strip")] |
11956 | pub reply_prefix_list_to_strip: Option<Vec<String>>, |
11957 | /// The prefix to use in reply subjects. The de facto prefix is "Re:". |
11958 | diff --git a/src/conf/listing.rs b/src/conf/listing.rs |
11959 | index 2bf4b3d..09079e6 100644 |
11960 | --- a/src/conf/listing.rs |
11961 | +++ b/src/conf/listing.rs |
11962 | @@ -19,9 +19,9 @@ |
11963 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
11964 | */ |
11965 | |
11966 | + use melib::{search::Query, Error, Result}; |
11967 | + |
11968 | use super::{default_vals::*, DotAddressable, IndexStyle}; |
11969 | - use melib::search::Query; |
11970 | - use melib::{Error, Result}; |
11971 | |
11972 | /// Settings for mail listings |
11973 | /// |
11974 | @@ -29,32 +29,32 @@ use melib::{Error, Result}; |
11975 | /// Tree decoration examples: |
11976 | /// |
11977 | ///```no_run |
11978 | - ///const HAS_SIBLING: &str = " ┃"; |
11979 | - ///const NO_SIBLING: &str = " "; |
11980 | - ///const HAS_SIBLING_LEAF: &str = " ┣━"; |
11981 | - ///const NO_SIBLING_LEAF: &str = " ┗━"; |
11982 | - ///``` |
11983 | + /// const HAS_SIBLING: &str = " ┃"; |
11984 | + /// const NO_SIBLING: &str = " "; |
11985 | + /// const HAS_SIBLING_LEAF: &str = " ┣━"; |
11986 | + /// const NO_SIBLING_LEAF: &str = " ┗━"; |
11987 | + /// ``` |
11988 | /// |
11989 | ///```no_run |
11990 | - ///const HAS_SIBLING: &str = " |"; |
11991 | - ///const NO_SIBLING: &str = " "; |
11992 | - ///const HAS_SIBLING_LEAF: &str = " |\\_"; |
11993 | - ///const NO_SIBLING_LEAF: &str = " \\_"; |
11994 | - ///``` |
11995 | + /// const HAS_SIBLING: &str = " |"; |
11996 | + /// const NO_SIBLING: &str = " "; |
11997 | + /// const HAS_SIBLING_LEAF: &str = " |\\_"; |
11998 | + /// const NO_SIBLING_LEAF: &str = " \\_"; |
11999 | + /// ``` |
12000 | /// |
12001 | ///```no_run |
12002 | - ///const HAS_SIBLING: &str = " "; |
12003 | - ///const NO_SIBLING: &str = " "; |
12004 | - ///const HAS_SIBLING_LEAF: &str = " "; |
12005 | - ///const NO_SIBLING_LEAF: &str = " "; |
12006 | - ///``` |
12007 | + /// const HAS_SIBLING: &str = " "; |
12008 | + /// const NO_SIBLING: &str = " "; |
12009 | + /// const HAS_SIBLING_LEAF: &str = " "; |
12010 | + /// const NO_SIBLING_LEAF: &str = " "; |
12011 | + /// ``` |
12012 | /// |
12013 | ///```no_run |
12014 | - ///const HAS_SIBLING: &str = " │"; |
12015 | - ///const NO_SIBLING: &str = " "; |
12016 | - ///const HAS_SIBLING_LEAF: &str = " ├─"; |
12017 | - ///const NO_SIBLING_LEAF: &str = " ╰─"; |
12018 | - ///``` |
12019 | + /// const HAS_SIBLING: &str = " │"; |
12020 | + /// const NO_SIBLING: &str = " "; |
12021 | + /// const HAS_SIBLING_LEAF: &str = " ├─"; |
12022 | + /// const NO_SIBLING_LEAF: &str = " ╰─"; |
12023 | + /// ``` |
12024 | #[derive(Debug, Deserialize, Clone, Serialize)] |
12025 | #[serde(deny_unknown_fields)] |
12026 | pub struct ListingSettings { |
12027 | @@ -130,8 +130,8 @@ pub struct ListingSettings { |
12028 | #[serde(default)] |
12029 | pub attachment_flag: Option<String>, |
12030 | |
12031 | - /// Should threads with differentiating Subjects show a list of those subjects on the entry |
12032 | - /// title? |
12033 | + /// Should threads with differentiating Subjects show a list of those |
12034 | + /// subjects on the entry title? |
12035 | /// Default: "true" |
12036 | #[serde(default = "true_val")] |
12037 | pub thread_subject_pack: bool, |
12038 | diff --git a/src/conf/notifications.rs b/src/conf/notifications.rs |
12039 | index ea68a47..b49741a 100644 |
12040 | --- a/src/conf/notifications.rs |
12041 | +++ b/src/conf/notifications.rs |
12042 | @@ -19,10 +19,13 @@ |
12043 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
12044 | */ |
12045 | |
12046 | - use super::default_vals::{internal_value_false, none, true_val}; |
12047 | - use super::DotAddressable; |
12048 | use melib::{Error, Result, ToggleFlag}; |
12049 | |
12050 | + use super::{ |
12051 | + default_vals::{internal_value_false, none, true_val}, |
12052 | + DotAddressable, |
12053 | + }; |
12054 | + |
12055 | /// Settings for the notifications function. |
12056 | #[derive(Debug, Serialize, Deserialize, Clone)] |
12057 | #[serde(deny_unknown_fields)] |
12058 | @@ -37,14 +40,14 @@ pub struct NotificationsSettings { |
12059 | #[serde(default = "none")] |
12060 | pub script: Option<String>, |
12061 | |
12062 | - /// A command to pipe new mail notifications through (preferred over `script`). |
12063 | - /// Default: None |
12064 | + /// A command to pipe new mail notifications through (preferred over |
12065 | + /// `script`). Default: None |
12066 | #[serde(default = "none")] |
12067 | pub new_mail_script: Option<String>, |
12068 | |
12069 | - /// A file location which has its size changed when new mail arrives (max 128 bytes). Can be |
12070 | - /// used to trigger new mail notifications eg with `xbiff(1)`. |
12071 | - /// Default: None |
12072 | + /// A file location which has its size changed when new mail arrives (max |
12073 | + /// 128 bytes). Can be used to trigger new mail notifications eg with |
12074 | + /// `xbiff(1)`. Default: None |
12075 | #[serde(default = "none", alias = "xbiff-file-path")] |
12076 | pub xbiff_file_path: Option<String>, |
12077 | |
12078 | diff --git a/src/conf/overrides.rs b/src/conf/overrides.rs |
12079 | index 4f0d4a6..b7f3e0c 100644 |
12080 | --- a/src/conf/overrides.rs |
12081 | +++ b/src/conf/overrides.rs |
12082 | @@ -1,3 +1,4 @@ |
12083 | + // @generated |
12084 | /* |
12085 | * meli - conf/overrides.rs |
12086 | * |
12087 | @@ -83,7 +84,8 @@ pub struct PagerSettingsOverride { |
12088 | #[serde(alias = "show-date-in-my-timezone")] |
12089 | #[serde(default)] |
12090 | pub show_date_in_my_timezone: Option<ToggleFlag>, |
12091 | - #[doc = " A command to launch URLs with. The URL will be given as the first argument of the command."] |
12092 | + #[doc = " A command to launch URLs with. The URL will be given as the first argument of the \ |
12093 | + command."] |
12094 | #[doc = " Default: None"] |
12095 | #[serde(deserialize_with = "non_empty_string")] |
12096 | #[serde(default)] |
12097 | @@ -177,7 +179,8 @@ pub struct ListingSettingsOverride { |
12098 | #[doc = " Default: \"📎\""] |
12099 | #[serde(default)] |
12100 | pub attachment_flag: Option<Option<String>>, |
12101 | - #[doc = " Should threads with differentiating Subjects show a list of those subjects on the entry"] |
12102 | + #[doc = " Should threads with differentiating Subjects show a list of those subjects on the \ |
12103 | + entry"] |
12104 | #[doc = " title?"] |
12105 | #[doc = " Default: \"true\""] |
12106 | #[serde(default)] |
12107 | @@ -222,7 +225,8 @@ pub struct NotificationsSettingsOverride { |
12108 | #[doc = " Default: None"] |
12109 | #[serde(default)] |
12110 | pub new_mail_script: Option<Option<String>>, |
12111 | - #[doc = " A file location which has its size changed when new mail arrives (max 128 bytes). Can be"] |
12112 | + #[doc = " A file location which has its size changed when new mail arrives (max 128 bytes). \ |
12113 | + Can be"] |
12114 | #[doc = " used to trigger new mail notifications eg with `xbiff(1)`."] |
12115 | #[doc = " Default: None"] |
12116 | #[serde(alias = "xbiff-file-path")] |
12117 | @@ -290,7 +294,8 @@ pub struct ComposingSettingsOverride { |
12118 | #[doc = " Required"] |
12119 | #[serde(default)] |
12120 | pub send_mail: Option<SendMail>, |
12121 | - #[doc = " Command to launch editor. Can have arguments. Draft filename is given as the last argument. If it's missing, the environment variable $EDITOR is looked up."] |
12122 | + #[doc = " Command to launch editor. Can have arguments. Draft filename is given as the last \ |
12123 | + argument. If it's missing, the environment variable $EDITOR is looked up."] |
12124 | #[serde(alias = "editor-command", alias = "editor-cmd", alias = "editor_cmd")] |
12125 | #[serde(default)] |
12126 | pub editor_command: Option<Option<String>>, |
12127 | @@ -312,14 +317,18 @@ pub struct ComposingSettingsOverride { |
12128 | #[serde(alias = "default-header-values")] |
12129 | #[serde(default)] |
12130 | pub default_header_values: Option<HashMap<String, String>>, |
12131 | - #[doc = " Wrap header preample when editing a draft in an editor. This allows you to write non-plain"] |
12132 | - #[doc = " text email without the preamble creating syntax errors. They are stripped when you return"] |
12133 | - #[doc = " from the editor. The values should be a two element array of strings, a prefix and suffix."] |
12134 | + #[doc = " Wrap header preample when editing a draft in an editor. This allows you to write \ |
12135 | + non-plain"] |
12136 | + #[doc = " text email without the preamble creating syntax errors. They are stripped when you \ |
12137 | + return"] |
12138 | + #[doc = " from the editor. The values should be a two element array of strings, a prefix and \ |
12139 | + suffix."] |
12140 | #[doc = " Default: None"] |
12141 | #[serde(alias = "wrap-header-preample")] |
12142 | #[serde(default)] |
12143 | pub wrap_header_preamble: Option<Option<(String, String)>>, |
12144 | - #[doc = " Store sent mail after successful submission. This setting is meant to be disabled for"] |
12145 | + #[doc = " Store sent mail after successful submission. This setting is meant to be disabled \ |
12146 | + for"] |
12147 | #[doc = " non-standard behaviour in gmail, which auto-saves sent mail on its own."] |
12148 | #[doc = " Default: true"] |
12149 | #[serde(default)] |
12150 | @@ -333,7 +342,8 @@ pub struct ComposingSettingsOverride { |
12151 | #[doc = " Default: \"On %a, %0e %b %Y %H:%M, %+f wrote:%n\""] |
12152 | #[serde(default)] |
12153 | pub attribution_format_string: Option<Option<String>>, |
12154 | - #[doc = " Whether the strftime call for the attribution string uses the POSIX locale instead of"] |
12155 | + #[doc = " Whether the strftime call for the attribution string uses the POSIX locale instead \ |
12156 | + of"] |
12157 | #[doc = " the user's active locale"] |
12158 | #[doc = " Default: true"] |
12159 | #[serde(default)] |
12160 | @@ -344,7 +354,13 @@ pub struct ComposingSettingsOverride { |
12161 | #[serde(default)] |
12162 | pub forward_as_attachment: Option<ToggleFlag>, |
12163 | #[doc = " Alternative lists of reply prefixes (etc. [\"Re:\", \"RE:\", ...]) to strip"] |
12164 | - #[doc = " Default: `[\"Re:\", \"RE:\", \"Fwd:\", \"Fw:\", \"回复:\", \"回覆:\", \"SV:\", \"Sv:\", \"VS:\", \"Antw:\", \"Doorst:\", \"VS:\", \"VL:\", \"REF:\", \"TR:\", \"TR:\", \"AW:\", \"WG:\", \"ΑΠ:\", \"Απ:\", \"απ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \"ΣΧΕΤ:\", \"Σχετ:\", \"σχετ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \"Vá:\", \"Továbbítás:\", \"R:\", \"I:\", \"RIF:\", \"FS:\", \"BLS:\", \"TRS:\", \"VS:\", \"VB:\", \"RV:\", \"RES:\", \"Res\", \"ENC:\", \"Odp:\", \"PD:\", \"YNT:\", \"İLT:\", \"ATB:\", \"YML:\"]`"] |
12165 | + #[doc = " Default: `[\"Re:\", \"RE:\", \"Fwd:\", \"Fw:\", \"回复:\", \"回覆:\", \"SV:\", \ |
12166 | + \"Sv:\", \"VS:\", \"Antw:\", \"Doorst:\", \"VS:\", \"VL:\", \"REF:\", \"TR:\", \ |
12167 | + \"TR:\", \"AW:\", \"WG:\", \"ΑΠ:\", \"Απ:\", \"απ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \ |
12168 | + \"ΣΧΕΤ:\", \"Σχετ:\", \"σχετ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \"Vá:\", \ |
12169 | + \"Továbbítás:\", \"R:\", \"I:\", \"RIF:\", \"FS:\", \"BLS:\", \"TRS:\", \"VS:\", \ |
12170 | + \"VB:\", \"RV:\", \"RES:\", \"Res\", \"ENC:\", \"Odp:\", \"PD:\", \"YNT:\", \ |
12171 | + \"İLT:\", \"ATB:\", \"YML:\"]`"] |
12172 | #[serde(alias = "reply-prefix-list-to-strip")] |
12173 | #[serde(default)] |
12174 | pub reply_prefix_list_to_strip: Option<Option<Vec<String>>>, |
12175 | diff --git a/src/conf/pager.rs b/src/conf/pager.rs |
12176 | index 38efeac..8bbce8d 100644 |
12177 | --- a/src/conf/pager.rs |
12178 | +++ b/src/conf/pager.rs |
12179 | @@ -21,11 +21,10 @@ |
12180 | |
12181 | //! Settings for the pager function. |
12182 | |
12183 | - use super::default_vals::*; |
12184 | - use super::deserializers::*; |
12185 | - use super::DotAddressable; |
12186 | use melib::{Error, Result, ToggleFlag}; |
12187 | |
12188 | + use super::{default_vals::*, deserializers::*, DotAddressable}; |
12189 | + |
12190 | /// Settings for the pager function. |
12191 | #[derive(Debug, Deserialize, Clone, Serialize)] |
12192 | #[serde(deny_unknown_fields)] |
12193 | @@ -79,8 +78,8 @@ pub struct PagerSettings { |
12194 | #[serde(default = "eighty_val", alias = "minimum-width")] |
12195 | pub minimum_width: usize, |
12196 | |
12197 | - /// Choose `text/html` alternative if `text/plain` is empty in `multipart/alternative` |
12198 | - /// attachments. |
12199 | + /// Choose `text/html` alternative if `text/plain` is empty in |
12200 | + /// `multipart/alternative` attachments. |
12201 | /// Default: true |
12202 | #[serde( |
12203 | default = "internal_value_true", |
12204 | @@ -93,8 +92,8 @@ pub struct PagerSettings { |
12205 | #[serde(default = "internal_value_true", alias = "show-date-in-my-timezone")] |
12206 | pub show_date_in_my_timezone: ToggleFlag, |
12207 | |
12208 | - /// A command to launch URLs with. The URL will be given as the first argument of the command. |
12209 | - /// Default: None |
12210 | + /// A command to launch URLs with. The URL will be given as the first |
12211 | + /// argument of the command. Default: None |
12212 | #[serde(default = "none", deserialize_with = "non_empty_string")] |
12213 | pub url_launcher: Option<String>, |
12214 | |
12215 | diff --git a/src/conf/pgp.rs b/src/conf/pgp.rs |
12216 | index 7d9ce7e..16cecc0 100644 |
12217 | --- a/src/conf/pgp.rs |
12218 | +++ b/src/conf/pgp.rs |
12219 | @@ -20,11 +20,12 @@ |
12220 | */ |
12221 | |
12222 | #[cfg(feature = "gpgme")] |
12223 | - use super::default_vals::*; |
12224 | - #[cfg(feature = "gpgme")] |
12225 | use melib::conf::ToggleFlag; |
12226 | |
12227 | #[cfg(feature = "gpgme")] |
12228 | + use super::default_vals::*; |
12229 | + |
12230 | + #[cfg(feature = "gpgme")] |
12231 | /// Settings for digital signing and encryption |
12232 | #[derive(Debug, Deserialize, Clone, Serialize)] |
12233 | #[serde(deny_unknown_fields)] |
12234 | diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs |
12235 | index 28d99e8..f85ec14 100644 |
12236 | --- a/src/conf/shortcuts.rs |
12237 | +++ b/src/conf/shortcuts.rs |
12238 | @@ -19,11 +19,12 @@ |
12239 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
12240 | */ |
12241 | |
12242 | - use super::DotAddressable; |
12243 | - use crate::terminal::Key; |
12244 | use indexmap::IndexMap; |
12245 | use melib::{Error, Result}; |
12246 | |
12247 | + use super::DotAddressable; |
12248 | + use crate::terminal::Key; |
12249 | + |
12250 | #[macro_export] |
12251 | macro_rules! shortcut { |
12252 | ($key:ident == $shortcuts:ident[$section:expr][$val:literal]) => { |
12253 | diff --git a/src/conf/tags.rs b/src/conf/tags.rs |
12254 | index 58559cd..4c06aad 100644 |
12255 | --- a/src/conf/tags.rs |
12256 | +++ b/src/conf/tags.rs |
12257 | @@ -21,11 +21,13 @@ |
12258 | |
12259 | //! E-mail tag configuration and {de,}serializing. |
12260 | |
12261 | - use super::DotAddressable; |
12262 | - use crate::terminal::Color; |
12263 | + use std::collections::{HashMap, HashSet}; |
12264 | + |
12265 | use melib::{Error, Result, TagHash}; |
12266 | use serde::{Deserialize, Deserializer}; |
12267 | - use std::collections::{HashMap, HashSet}; |
12268 | + |
12269 | + use super::DotAddressable; |
12270 | + use crate::terminal::Color; |
12271 | |
12272 | #[derive(Default, Debug, Deserialize, Clone, Serialize)] |
12273 | #[serde(deny_unknown_fields)] |
12274 | diff --git a/src/conf/terminal.rs b/src/conf/terminal.rs |
12275 | index 57faafe..6b3beeb 100644 |
12276 | --- a/src/conf/terminal.rs |
12277 | +++ b/src/conf/terminal.rs |
12278 | @@ -21,11 +21,10 @@ |
12279 | |
12280 | //! Settings for terminal display |
12281 | |
12282 | - use super::deserializers::non_empty_string; |
12283 | - use super::DotAddressable; |
12284 | - use super::Themes; |
12285 | use melib::{Error, Result, ToggleFlag}; |
12286 | |
12287 | + use super::{deserializers::non_empty_string, DotAddressable, Themes}; |
12288 | + |
12289 | /// Settings for terminal display |
12290 | #[derive(Debug, Deserialize, Clone, Serialize)] |
12291 | #[serde(default, deny_unknown_fields)] |
12292 | @@ -35,8 +34,8 @@ pub struct TerminalSettings { |
12293 | pub themes: Themes, |
12294 | pub ascii_drawing: bool, |
12295 | pub use_color: ToggleFlag, |
12296 | - /// Use mouse events. This will disable text selection, but you will be able to resize some |
12297 | - /// widgets. |
12298 | + /// Use mouse events. This will disable text selection, but you will be able |
12299 | + /// to resize some widgets. |
12300 | /// Default: False |
12301 | pub use_mouse: ToggleFlag, |
12302 | /// String to show in status bar if mouse is active. |
12303 | @@ -47,9 +46,9 @@ pub struct TerminalSettings { |
12304 | pub window_title: Option<String>, |
12305 | #[serde(deserialize_with = "non_empty_string")] |
12306 | pub file_picker_command: Option<String>, |
12307 | - /// Choose between 30-something built in sequences (integers between 0-30) or define your own |
12308 | - /// list of strings for the progress spinner animation. |
12309 | - /// Default: 0 |
12310 | + /// Choose between 30-something built in sequences (integers between 0-30) |
12311 | + /// or define your own list of strings for the progress spinner |
12312 | + /// animation. Default: 0 |
12313 | #[serde(default)] |
12314 | pub progress_spinner_sequence: Option<ProgressSpinnerSequence>, |
12315 | } |
12316 | diff --git a/src/conf/themes.rs b/src/conf/themes.rs |
12317 | index 204e859..1543be8 100644 |
12318 | --- a/src/conf/themes.rs |
12319 | +++ b/src/conf/themes.rs |
12320 | @@ -21,22 +21,26 @@ |
12321 | |
12322 | //! Application themes. |
12323 | //! |
12324 | - //! * An attribute is a triple of foreground color, background color and terminal attribute `ThemeValue`s. |
12325 | - //! * A `ThemeValue<T>` is either an actual value or the key name of another value to which it depends. The value is either `Color` or `Attr`. |
12326 | + //! * An attribute is a triple of foreground color, background color and |
12327 | + //! terminal attribute `ThemeValue`s. |
12328 | + //! * A `ThemeValue<T>` is either an actual value or the key name of another |
12329 | + //! value to which it depends. The value is either `Color` or `Attr`. |
12330 | //! * `ThemeAttributeInner` is an attribute triplet. |
12331 | //! * `ThemeAttribute` is an attribute triplet with the links resolved. |
12332 | //! |
12333 | //! On startup a [DFS](https://en.wikipedia.org/wiki/Depth-first_search) is performed to see if there are any cycles in the link graph. |
12334 | |
12335 | - use crate::terminal::{Attr, Color}; |
12336 | - use crate::Context; |
12337 | + use std::{borrow::Cow, collections::HashSet, fmt::Write}; |
12338 | + |
12339 | use indexmap::IndexMap; |
12340 | use melib::{Error, Result}; |
12341 | use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; |
12342 | use smallvec::SmallVec; |
12343 | - use std::borrow::Cow; |
12344 | - use std::collections::HashSet; |
12345 | - use std::fmt::Write; |
12346 | + |
12347 | + use crate::{ |
12348 | + terminal::{Attr, Color}, |
12349 | + Context, |
12350 | + }; |
12351 | |
12352 | #[inline(always)] |
12353 | pub fn value(context: &Context, key: &'static str) -> ThemeAttribute { |
12354 | @@ -364,7 +368,8 @@ impl ThemeLink for Attr { |
12355 | } |
12356 | |
12357 | #[derive(Debug, Clone)] |
12358 | - /// Holds either an actual value or refers to the key name of the attribute that holds the value. |
12359 | + /// Holds either an actual value or refers to the key name of the attribute that |
12360 | + /// holds the value. |
12361 | enum ThemeValue<T: ThemeLink> { |
12362 | Value(T), |
12363 | Alias(Cow<'static, str>), |
12364 | @@ -839,7 +844,6 @@ impl<'de> Deserialize<'de> for Themes { |
12365 | s.light |
12366 | .keys |
12367 | .keys() |
12368 | - .into_iter() |
12369 | .map(|k| k.as_ref()) |
12370 | .collect::<SmallVec<[_; 128]>>() |
12371 | .join(", ") |
12372 | @@ -895,7 +899,6 @@ impl<'de> Deserialize<'de> for Themes { |
12373 | s.dark |
12374 | .keys |
12375 | .keys() |
12376 | - .into_iter() |
12377 | .map(|k| k.as_ref()) |
12378 | .collect::<SmallVec<[_; 128]>>() |
12379 | .join(", ") |
12380 | @@ -954,7 +957,6 @@ impl<'de> Deserialize<'de> for Themes { |
12381 | theme |
12382 | .keys |
12383 | .keys() |
12384 | - .into_iter() |
12385 | .map(|k| k.as_ref()) |
12386 | .collect::<SmallVec<[_; 128]>>() |
12387 | .join(", ") |
12388 | @@ -2038,7 +2040,8 @@ fn test_theme_parsing() { |
12389 | /* MUST SUCCEED: default themes should be valid */ |
12390 | let def = Themes::default(); |
12391 | assert!(def.validate().is_ok()); |
12392 | - /* MUST SUCCEED: new user theme `hunter2`, theme `dark` has user redefinitions */ |
12393 | + /* MUST SUCCEED: new user theme `hunter2`, theme `dark` has user |
12394 | + * redefinitions */ |
12395 | const TEST_STR: &str = r##"[dark] |
12396 | "mail.listing.tag_default" = { fg = "White", bg = "HotPink3" } |
12397 | "mail.listing.attachment_flag" = { fg = "mail.listing.tag_default.bg" } |
12398 | @@ -2147,10 +2150,7 @@ color_aliases= { "Jebediah" = "$JebediahJr", "JebediahJr" = "mail.listing.tag_de |
12399 | |
12400 | #[test] |
12401 | fn test_theme_key_values() { |
12402 | - use std::collections::VecDeque; |
12403 | - use std::fs::File; |
12404 | - use std::io::Read; |
12405 | - use std::path::PathBuf; |
12406 | + use std::{collections::VecDeque, fs::File, io::Read, path::PathBuf}; |
12407 | let mut rust_files: VecDeque<PathBuf> = VecDeque::new(); |
12408 | let mut dirs_queue: VecDeque<PathBuf> = VecDeque::new(); |
12409 | dirs_queue.push_back("src/".into()); |
12410 | @@ -2162,9 +2162,9 @@ fn test_theme_key_values() { |
12411 | let entry = entry.unwrap(); |
12412 | let path = entry.path(); |
12413 | if path.is_dir() { |
12414 | - dirs_queue.push_back(path.into()); |
12415 | + dirs_queue.push_back(path); |
12416 | } else if path.extension().map(|os_s| os_s == "rs").unwrap_or(false) { |
12417 | - rust_files.push_back(path.into()); |
12418 | + rust_files.push_back(path); |
12419 | } |
12420 | } |
12421 | } |
12422 | @@ -2176,7 +2176,12 @@ fn test_theme_key_values() { |
12423 | for mat in re_conf.captures_iter(&content) { |
12424 | let theme_key = &mat[1]; |
12425 | if !DEFAULT_KEYS.contains(&theme_key) { |
12426 | - panic!("Source file {} contains a hardcoded theme key str, {:?}, that is not included in the DEFAULT_KEYS table.", file_path.display(), theme_key); |
12427 | + panic!( |
12428 | + "Source file {} contains a hardcoded theme key str, {:?}, that is not \ |
12429 | + included in the DEFAULT_KEYS table.", |
12430 | + file_path.display(), |
12431 | + theme_key |
12432 | + ); |
12433 | } |
12434 | } |
12435 | } |
12436 | diff --git a/src/jobs.rs b/src/jobs.rs |
12437 | index d201c5e..58c3997 100644 |
12438 | --- a/src/jobs.rs |
12439 | +++ b/src/jobs.rs |
12440 | @@ -21,21 +21,25 @@ |
12441 | |
12442 | //! Async job executor thread pool |
12443 | |
12444 | - use melib::smol; |
12445 | - use melib::uuid::Uuid; |
12446 | - use std::collections::HashMap; |
12447 | - use std::future::Future; |
12448 | - use std::panic::catch_unwind; |
12449 | - use std::sync::{Arc, Mutex}; |
12450 | - use std::thread; |
12451 | - use std::time::Duration; |
12452 | + use std::{ |
12453 | + collections::HashMap, |
12454 | + future::Future, |
12455 | + iter, |
12456 | + panic::catch_unwind, |
12457 | + sync::{Arc, Mutex}, |
12458 | + thread, |
12459 | + time::Duration, |
12460 | + }; |
12461 | + |
12462 | + use crossbeam::{ |
12463 | + channel::Sender, |
12464 | + deque::{Injector, Stealer, Worker}, |
12465 | + sync::{Parker, Unparker}, |
12466 | + }; |
12467 | + pub use futures::channel::oneshot; |
12468 | + use melib::{smol, uuid::Uuid}; |
12469 | |
12470 | use crate::types::{ThreadEvent, UIEvent}; |
12471 | - use crossbeam::channel::Sender; |
12472 | - use crossbeam::deque::{Injector, Stealer, Worker}; |
12473 | - use crossbeam::sync::{Parker, Unparker}; |
12474 | - pub use futures::channel::oneshot; |
12475 | - use std::iter; |
12476 | |
12477 | type AsyncTask = async_task::Runnable; |
12478 | |
12479 | @@ -245,7 +249,8 @@ impl JobExecutor { |
12480 | } |
12481 | } |
12482 | |
12483 | - /// Spawns a future with a generic return value `R` that might block on a new thread |
12484 | + /// Spawns a future with a generic return value `R` that might block on a |
12485 | + /// new thread |
12486 | pub fn spawn_blocking<F, R>(&self, future: F) -> JoinHandle<R> |
12487 | where |
12488 | F: Future<Output = R> + Send + 'static, |
12489 | diff --git a/src/lib.rs b/src/lib.rs |
12490 | index b972621..875b50c 100644 |
12491 | --- a/src/lib.rs |
12492 | +++ b/src/lib.rs |
12493 | @@ -20,16 +20,16 @@ |
12494 | */ |
12495 | |
12496 | //! |
12497 | - //! This crate contains the frontend stuff of the application. The application entry way on |
12498 | - //! `src/bin.rs` creates an event loop and passes input to a thread. |
12499 | - //! |
12500 | - //! The mail handling stuff is done in the `melib` crate which includes all backend needs. The |
12501 | - //! split is done to theoretically be able to create different frontends with the same innards. |
12502 | + //! This crate contains the frontend stuff of the application. The application |
12503 | + //! entry way on `src/bin.rs` creates an event loop and passes input to a |
12504 | + //! thread. |
12505 | //! |
12506 | + //! The mail handling stuff is done in the `melib` crate which includes all |
12507 | + //! backend needs. The split is done to theoretically be able to create |
12508 | + //! different frontends with the same innards. |
12509 | |
12510 | use std::alloc::System; |
12511 | - pub use std::collections::VecDeque; |
12512 | - pub use std::path::PathBuf; |
12513 | + pub use std::{collections::VecDeque, path::PathBuf}; |
12514 | |
12515 | #[macro_use] |
12516 | extern crate serde_derive; |
12517 | diff --git a/src/mailcap.rs b/src/mailcap.rs |
12518 | index 62a3552..1c8a1e0 100644 |
12519 | --- a/src/mailcap.rs |
12520 | +++ b/src/mailcap.rs |
12521 | @@ -21,17 +21,21 @@ |
12522 | |
12523 | //! # mailcap file - Find mailcap entries to execute attachments. |
12524 | //! |
12525 | - //! Implements [RFC 1524 A User Agent Configuration Mechanism For Multimedia Mail Format |
12526 | - //! Information](https://www.rfc-editor.org/rfc/inline-errata/rfc1524.html) |
12527 | - use crate::state::Context; |
12528 | - use crate::types::{create_temp_file, ForkType, UIEvent}; |
12529 | - use melib::text_processing::GlobMatch; |
12530 | - use melib::{email::Attachment, Error, Result}; |
12531 | - use std::collections::HashMap; |
12532 | - use std::io::Read; |
12533 | - use std::io::Write; |
12534 | - use std::path::PathBuf; |
12535 | - use std::process::{Command, Stdio}; |
12536 | + //! Implements [RFC 1524 A User Agent Configuration Mechanism For Multimedia |
12537 | + //! Mail Format Information](https://www.rfc-editor.org/rfc/inline-errata/rfc1524.html) |
12538 | + use std::{ |
12539 | + collections::HashMap, |
12540 | + io::{Read, Write}, |
12541 | + path::PathBuf, |
12542 | + process::{Command, Stdio}, |
12543 | + }; |
12544 | + |
12545 | + use melib::{email::Attachment, text_processing::GlobMatch, Error, Result}; |
12546 | + |
12547 | + use crate::{ |
12548 | + state::Context, |
12549 | + types::{create_temp_file, ForkType, UIEvent}, |
12550 | + }; |
12551 | |
12552 | pub struct MailcapEntry { |
12553 | command: String, |
12554 | @@ -42,7 +46,8 @@ pub struct MailcapEntry { |
12555 | impl MailcapEntry { |
12556 | pub fn execute(a: &Attachment, context: &mut Context) -> Result<()> { |
12557 | /* lookup order: |
12558 | - * $XDG_CONFIG_HOME/meli/mailcap:$XDG_CONFIG_HOME/.mailcap:$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap |
12559 | + * $XDG_CONFIG_HOME/meli/mailcap:$XDG_CONFIG_HOME/.mailcap:$HOME/.mailcap:/ |
12560 | + * etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap |
12561 | */ |
12562 | let xdg_dirs = |
12563 | xdg::BaseDirectories::with_prefix("meli").map_err(|e| Error::new(e.to_string()))?; |
12564 | @@ -188,7 +193,7 @@ impl MailcapEntry { |
12565 | if copiousoutput { |
12566 | let out = if needs_stdin { |
12567 | let mut child = Command::new("sh") |
12568 | - .args(&["-c", &cmd_string]) |
12569 | + .args(["-c", &cmd_string]) |
12570 | .stdin(Stdio::piped()) |
12571 | .stdout(Stdio::piped()) |
12572 | .spawn()?; |
12573 | @@ -201,7 +206,7 @@ impl MailcapEntry { |
12574 | child.wait_with_output()?.stdout |
12575 | } else { |
12576 | let child = Command::new("sh") |
12577 | - .args(&["-c", &cmd_string]) |
12578 | + .args(["-c", &cmd_string]) |
12579 | .stdin(Stdio::piped()) |
12580 | .stdout(Stdio::piped()) |
12581 | .spawn()?; |
12582 | @@ -223,7 +228,7 @@ impl MailcapEntry { |
12583 | debug!(pager.wait_with_output()?.stdout); |
12584 | } else if needs_stdin { |
12585 | let mut child = Command::new("sh") |
12586 | - .args(&["-c", &cmd_string]) |
12587 | + .args(["-c", &cmd_string]) |
12588 | .stdin(Stdio::piped()) |
12589 | .stdout(Stdio::inherit()) |
12590 | .spawn()?; |
12591 | @@ -236,7 +241,7 @@ impl MailcapEntry { |
12592 | debug!(child.wait_with_output()?.stdout); |
12593 | } else { |
12594 | let child = Command::new("sh") |
12595 | - .args(&["-c", &cmd_string]) |
12596 | + .args(["-c", &cmd_string]) |
12597 | .stdin(Stdio::inherit()) |
12598 | .stdout(Stdio::inherit()) |
12599 | .spawn()?; |
12600 | diff --git a/src/main.rs b/src/main.rs |
12601 | index 408352b..07d828b 100644 |
12602 | --- a/src/main.rs |
12603 | +++ b/src/main.rs |
12604 | @@ -21,17 +21,20 @@ |
12605 | |
12606 | //! Command line client binary. |
12607 | //! |
12608 | - //! This crate contains the frontend stuff of the application. The application entry way on |
12609 | - //! `src/bin.rs` creates an event loop and passes input to a thread. |
12610 | + //! This crate contains the frontend stuff of the application. The application |
12611 | + //! entry way on `src/bin.rs` creates an event loop and passes input to a |
12612 | + //! thread. |
12613 | //! |
12614 | - //! The mail handling stuff is done in the `melib` crate which includes all backend needs. The |
12615 | - //! split is done to theoretically be able to create different frontends with the same innards. |
12616 | + //! The mail handling stuff is done in the `melib` crate which includes all |
12617 | + //! backend needs. The split is done to theoretically be able to create |
12618 | + //! different frontends with the same innards. |
12619 | |
12620 | use meli::*; |
12621 | mod args; |
12622 | - use args::*; |
12623 | use std::os::raw::c_int; |
12624 | |
12625 | + use args::*; |
12626 | + |
12627 | fn notify( |
12628 | signals: &[c_int], |
12629 | sender: crossbeam::channel::Sender<ThreadEvent>, |
12630 | @@ -119,7 +122,10 @@ fn run_app(opt: Opt) -> Result<()> { |
12631 | let editor = std::env::var("EDITOR") |
12632 | .or_else(|_| std::env::var("VISUAL")) |
12633 | .map_err(|err| { |
12634 | - format!("Could not find any value in environment variables EDITOR and VISUAL. {err}") |
12635 | + format!( |
12636 | + "Could not find any value in environment variables EDITOR and VISUAL. \ |
12637 | + {err}" |
12638 | + ) |
12639 | })?; |
12640 | let config_path = crate::conf::get_config_file()?; |
12641 | |
12642 | @@ -146,8 +152,9 @@ fn run_app(opt: Opt) -> Result<()> { |
12643 | include_bytes!(concat!(env!("OUT_DIR"), "/meli-themes.txt.gz")), |
12644 | include_bytes!(concat!(env!("OUT_DIR"), "/meli.7.txt.gz")), |
12645 | ]; |
12646 | - use flate2::bufread::GzDecoder; |
12647 | use std::io::prelude::*; |
12648 | + |
12649 | + use flate2::bufread::GzDecoder; |
12650 | let mut gz = GzDecoder::new(MANPAGES[page as usize]); |
12651 | let mut v = String::with_capacity( |
12652 | str::parse::<usize>(unsafe { |
12653 | @@ -231,8 +238,9 @@ fn run_app(opt: Opt) -> Result<()> { |
12654 | None => {} |
12655 | } |
12656 | |
12657 | - /* Create a channel to communicate with other threads. The main process is the sole receiver. |
12658 | - * */ |
12659 | + /* Create a channel to communicate with other threads. The main process is |
12660 | + * the sole receiver. |
12661 | + */ |
12662 | let (sender, receiver) = crossbeam::channel::bounded(32 * ::std::mem::size_of::<ThreadEvent>()); |
12663 | /* Catch SIGWINCH to handle terminal resizing */ |
12664 | let signals = &[ |
12665 | @@ -310,7 +318,8 @@ fn run_app(opt: Opt) -> Result<()> { |
12666 | } |
12667 | state.redraw(); |
12668 | |
12669 | - /* Poll on all channels. Currently we have the input channel for stdin, watching events and the signal watcher. */ |
12670 | + /* Poll on all channels. Currently we have the input channel for stdin, |
12671 | + * watching events and the signal watcher. */ |
12672 | crossbeam::select! { |
12673 | recv(receiver) -> r => { |
12674 | match r { |
12675 | diff --git a/src/managesieve.rs b/src/managesieve.rs |
12676 | index f68ef43..a9538ca 100644 |
12677 | --- a/src/managesieve.rs |
12678 | +++ b/src/managesieve.rs |
12679 | @@ -21,9 +21,9 @@ |
12680 | |
12681 | #[macro_use] |
12682 | extern crate melib; |
12683 | - use melib::*; |
12684 | - |
12685 | use std::collections::VecDeque; |
12686 | + |
12687 | + use melib::*; |
12688 | #[macro_use] |
12689 | extern crate serde_derive; |
12690 | extern crate linkify; |
12691 | @@ -32,8 +32,7 @@ extern crate serde_json; |
12692 | extern crate smallvec; |
12693 | extern crate termion; |
12694 | |
12695 | - use melib::backends::imap::managesieve::ManageSieveConnection; |
12696 | - use melib::Result; |
12697 | + use melib::{backends::imap::managesieve::ManageSieveConnection, Result}; |
12698 | |
12699 | #[macro_use] |
12700 | pub mod types; |
12701 | @@ -66,14 +65,16 @@ pub mod mailcap; |
12702 | |
12703 | use futures::executor::block_on; |
12704 | |
12705 | - /// Opens an interactive shell on a managesieve server. Suggested use is with rlwrap(1) |
12706 | + /// Opens an interactive shell on a managesieve server. Suggested use is with |
12707 | + /// rlwrap(1) |
12708 | /// |
12709 | /// # Example invocation: |
12710 | /// ```sh |
12711 | /// ./manage_sieve server_hostname server_username server_password server_port"); |
12712 | /// ``` |
12713 | /// |
12714 | - /// `danger_accept_invalid_certs` is turned on by default, so no certificate validation is performed. |
12715 | + /// `danger_accept_invalid_certs` is turned on by default, so no certificate |
12716 | + /// validation is performed. |
12717 | |
12718 | fn main() -> Result<()> { |
12719 | let mut args = std::env::args().skip(1).collect::<Vec<String>>(); |
12720 | @@ -139,8 +140,7 @@ fn main() -> Result<()> { |
12721 | use PrevCmd::*; |
12722 | let mut prev_cmd: PrevCmd = None; |
12723 | loop { |
12724 | - use std::io; |
12725 | - use std::io::Write; |
12726 | + use std::{io, io::Write}; |
12727 | input.clear(); |
12728 | print!("> "); |
12729 | io::stdout().flush().unwrap(); |
12730 | @@ -193,7 +193,7 @@ fn main() -> Result<()> { |
12731 | match prev_cmd { |
12732 | None => println!("invalid command `{}`", input), |
12733 | Checkscript => { |
12734 | - let content = std::fs::read_to_string(&input).unwrap(); |
12735 | + let content = std::fs::read_to_string(input).unwrap(); |
12736 | let result = block_on(conn.checkscript(content.as_bytes())); |
12737 | println!("Got {:?}", result); |
12738 | prev_cmd = None; |
12739 | @@ -204,7 +204,7 @@ fn main() -> Result<()> { |
12740 | } |
12741 | PutscriptString(name) => { |
12742 | prev_cmd = None; |
12743 | - let content = std::fs::read_to_string(&input).unwrap(); |
12744 | + let content = std::fs::read_to_string(input).unwrap(); |
12745 | let result = |
12746 | block_on(conn.putscript(name.as_bytes(), content.as_bytes())); |
12747 | println!("Got {:?}", result); |
12748 | diff --git a/src/sqlite3.rs b/src/sqlite3.rs |
12749 | index 4348cd1..be15ded 100644 |
12750 | --- a/src/sqlite3.rs |
12751 | +++ b/src/sqlite3.rs |
12752 | @@ -21,27 +21,31 @@ |
12753 | |
12754 | /*! Use an sqlite3 database for fast searching. |
12755 | */ |
12756 | - use crate::melib::ResultIntoError; |
12757 | - use melib::search::{ |
12758 | - escape_double_quote, |
12759 | - Query::{self, *}, |
12760 | + use std::{ |
12761 | + path::PathBuf, |
12762 | + sync::{Arc, RwLock}, |
12763 | }; |
12764 | + |
12765 | use melib::{ |
12766 | backends::{MailBackend, ResultFuture}, |
12767 | email::{Envelope, EnvelopeHash}, |
12768 | log, |
12769 | + search::{ |
12770 | + escape_double_quote, |
12771 | + Query::{self, *}, |
12772 | + }, |
12773 | sqlite3::{self as melib_sqlite3, rusqlite::params, DatabaseDescription}, |
12774 | thread::{SortField, SortOrder}, |
12775 | Error, Result, ERROR, |
12776 | }; |
12777 | - |
12778 | use smallvec::SmallVec; |
12779 | - use std::path::PathBuf; |
12780 | - use std::sync::{Arc, RwLock}; |
12781 | + |
12782 | + use crate::melib::ResultIntoError; |
12783 | |
12784 | const DB: DatabaseDescription = DatabaseDescription { |
12785 | - name: "index.db", |
12786 | - init_script:Some( "CREATE TABLE IF NOT EXISTS envelopes ( |
12787 | + name: "index.db", |
12788 | + init_script: Some( |
12789 | + "CREATE TABLE IF NOT EXISTS envelopes ( |
12790 | id INTEGER PRIMARY KEY, |
12791 | account_id INTEGER REFERENCES accounts ON UPDATE CASCADE, |
12792 | hash BLOB NOT NULL UNIQUE, |
12793 | @@ -89,7 +93,8 @@ CREATE INDEX IF NOT EXISTS envelope_cc_index ON envelopes (cc); |
12794 | CREATE INDEX IF NOT EXISTS envelope_bcc_index ON envelopes (bcc); |
12795 | CREATE INDEX IF NOT EXISTS envelope_message_id_index ON envelopes (message_id); |
12796 | |
12797 | - CREATE VIRTUAL TABLE IF NOT EXISTS fts USING fts5(subject, body_text, content=envelopes, content_rowid=id); |
12798 | + CREATE VIRTUAL TABLE IF NOT EXISTS fts USING fts5(subject, body_text, content=envelopes, \ |
12799 | + content_rowid=id); |
12800 | |
12801 | -- Triggers to keep the FTS index up to date. |
12802 | CREATE TRIGGER IF NOT EXISTS envelopes_ai AFTER INSERT ON envelopes BEGIN |
12803 | @@ -97,14 +102,17 @@ CREATE TRIGGER IF NOT EXISTS envelopes_ai AFTER INSERT ON envelopes BEGIN |
12804 | END; |
12805 | |
12806 | CREATE TRIGGER IF NOT EXISTS envelopes_ad AFTER DELETE ON envelopes BEGIN |
12807 | - INSERT INTO fts(fts, rowid, subject, body_text) VALUES('delete', old.id, old.subject, old.body_text); |
12808 | + INSERT INTO fts(fts, rowid, subject, body_text) VALUES('delete', old.id, old.subject, \ |
12809 | + old.body_text); |
12810 | END; |
12811 | |
12812 | CREATE TRIGGER IF NOT EXISTS envelopes_au AFTER UPDATE ON envelopes BEGIN |
12813 | - INSERT INTO fts(fts, rowid, subject, body_text) VALUES('delete', old.id, old.subject, old.body_text); |
12814 | + INSERT INTO fts(fts, rowid, subject, body_text) VALUES('delete', old.id, old.subject, \ |
12815 | + old.body_text); |
12816 | INSERT INTO fts(rowid, subject, body_text) VALUES (new.id, new.subject, new.body_text); |
12817 | - END; "), |
12818 | - version: 1, |
12819 | + END; ", |
12820 | + ), |
12821 | + version: 1, |
12822 | }; |
12823 | |
12824 | pub fn db_path() -> Result<PathBuf> { |
12825 | @@ -126,8 +134,8 @@ pub fn db_path() -> Result<PathBuf> { |
12826 | // || b != 0x60 |
12827 | // || b != 26 |
12828 | // { |
12829 | - // return Cow::from(format!("\"{}\"", escape_double_quote(w))); |
12830 | - // } |
12831 | + // return Cow::from(format!("\"{}\"", |
12832 | + // escape_double_quote(w))); } |
12833 | // } |
12834 | // Cow::from(w) |
12835 | // } |
12836 | @@ -209,26 +217,49 @@ pub async fn insert( |
12837 | .unwrap(); |
12838 | x |
12839 | }; |
12840 | - if let Err(err) = conn.execute( |
12841 | - "INSERT OR REPLACE INTO envelopes (account_id, hash, date, _from, _to, cc, bcc, subject, message_id, in_reply_to, _references, flags, has_attachments, body_text, timestamp) |
12842 | + if let Err(err) = conn |
12843 | + .execute( |
12844 | + "INSERT OR REPLACE INTO envelopes (account_id, hash, date, _from, _to, cc, bcc, \ |
12845 | + subject, message_id, in_reply_to, _references, flags, has_attachments, body_text, \ |
12846 | + timestamp) |
12847 | VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15)", |
12848 | - params![account_id, envelope.hash().to_be_bytes().to_vec(), envelope.date_as_str(), envelope.field_from_to_string(), envelope.field_to_to_string(), envelope.field_cc_to_string(), envelope.field_bcc_to_string(), envelope.subject().into_owned().trim_end_matches('\u{0}'), envelope.message_id_display().to_string(), envelope.in_reply_to_display().map(|f| f.to_string()).unwrap_or_default(), envelope.field_references_to_string(), i64::from(envelope.flags().bits()), if envelope.has_attachments() { 1 } else { 0 }, body, envelope.date().to_be_bytes().to_vec()], |
12849 | + params![ |
12850 | + account_id, |
12851 | + envelope.hash().to_be_bytes().to_vec(), |
12852 | + envelope.date_as_str(), |
12853 | + envelope.field_from_to_string(), |
12854 | + envelope.field_to_to_string(), |
12855 | + envelope.field_cc_to_string(), |
12856 | + envelope.field_bcc_to_string(), |
12857 | + envelope.subject().into_owned().trim_end_matches('\u{0}'), |
12858 | + envelope.message_id_display().to_string(), |
12859 | + envelope |
12860 | + .in_reply_to_display() |
12861 | + .map(|f| f.to_string()) |
12862 | + .unwrap_or_default(), |
12863 | + envelope.field_references_to_string(), |
12864 | + i64::from(envelope.flags().bits()), |
12865 | + if envelope.has_attachments() { 1 } else { 0 }, |
12866 | + body, |
12867 | + envelope.date().to_be_bytes().to_vec() |
12868 | + ], |
12869 | ) |
12870 | - .map_err(|e| Error::new(e.to_string())) { |
12871 | - debug!( |
12872 | - "Failed to insert envelope {}: {}", |
12873 | - envelope.message_id_display(), |
12874 | - err |
12875 | - ); |
12876 | - log( |
12877 | - format!( |
12878 | - "Failed to insert envelope {}: {}", |
12879 | - envelope.message_id_display(), |
12880 | - err |
12881 | - ), |
12882 | - ERROR, |
12883 | - ); |
12884 | - } |
12885 | + .map_err(|e| Error::new(e.to_string())) |
12886 | + { |
12887 | + debug!( |
12888 | + "Failed to insert envelope {}: {}", |
12889 | + envelope.message_id_display(), |
12890 | + err |
12891 | + ); |
12892 | + log( |
12893 | + format!( |
12894 | + "Failed to insert envelope {}: {}", |
12895 | + envelope.message_id_display(), |
12896 | + err |
12897 | + ), |
12898 | + ERROR, |
12899 | + ); |
12900 | + } |
12901 | Ok(()) |
12902 | } |
12903 | |
12904 | @@ -313,10 +344,34 @@ pub fn index(context: &mut crate::state::Context, account_index: usize) -> Resul |
12905 | let envelopes_lck = acc_mutex.read().unwrap(); |
12906 | if let Some(e) = envelopes_lck.get(env_hash) { |
12907 | let body = e.body_bytes(&bytes).text().replace('\0', ""); |
12908 | - conn.execute("INSERT OR REPLACE INTO envelopes (account_id, hash, date, _from, _to, cc, bcc, subject, message_id, in_reply_to, _references, flags, has_attachments, body_text, timestamp) |
12909 | + conn.execute( |
12910 | + "INSERT OR REPLACE INTO envelopes (account_id, hash, date, _from, _to, \ |
12911 | + cc, bcc, subject, message_id, in_reply_to, _references, flags, \ |
12912 | + has_attachments, body_text, timestamp) |
12913 | VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15)", |
12914 | - params![account_id, e.hash().to_be_bytes().to_vec(), e.date_as_str(), e.field_from_to_string(), e.field_to_to_string(), e.field_cc_to_string(), e.field_bcc_to_string(), e.subject().into_owned().trim_end_matches('\u{0}'), e.message_id_display().to_string(), e.in_reply_to_display().map(|f| f.to_string()).unwrap_or_default(), e.field_references_to_string(), i64::from(e.flags().bits()), if e.has_attachments() { 1 } else { 0 }, body, e.date().to_be_bytes().to_vec()], |
12915 | - ).chain_err_summary(|| format!( "Failed to insert envelope {}", e.message_id_display()))?; |
12916 | + params![ |
12917 | + account_id, |
12918 | + e.hash().to_be_bytes().to_vec(), |
12919 | + e.date_as_str(), |
12920 | + e.field_from_to_string(), |
12921 | + e.field_to_to_string(), |
12922 | + e.field_cc_to_string(), |
12923 | + e.field_bcc_to_string(), |
12924 | + e.subject().into_owned().trim_end_matches('\u{0}'), |
12925 | + e.message_id_display().to_string(), |
12926 | + e.in_reply_to_display() |
12927 | + .map(|f| f.to_string()) |
12928 | + .unwrap_or_default(), |
12929 | + e.field_references_to_string(), |
12930 | + i64::from(e.flags().bits()), |
12931 | + if e.has_attachments() { 1 } else { 0 }, |
12932 | + body, |
12933 | + e.date().to_be_bytes().to_vec() |
12934 | + ], |
12935 | + ) |
12936 | + .chain_err_summary(|| { |
12937 | + format!("Failed to insert envelope {}", e.message_id_display()) |
12938 | + })?; |
12939 | } |
12940 | } |
12941 | let sleep_dur = std::time::Duration::from_millis(20); |
12942 | @@ -478,14 +533,14 @@ pub fn query_to_sql(q: &Query) -> String { |
12943 | |
12944 | #[test] |
12945 | fn test_query_to_sql() { |
12946 | - use melib::parsec::Parser; |
12947 | - use melib::search::query; |
12948 | + use melib::{parsec::Parser, search::query}; |
12949 | assert_eq!( |
12950 | "(subject LIKE \"%test%\" ) AND (body_text LIKE \"%i%\" ) ", |
12951 | &query_to_sql(&query().parse_complete("subject: test and i").unwrap().1) |
12952 | ); |
12953 | assert_eq!( |
12954 | - "(subject LIKE \"%github%\" ) OR ((_from LIKE \"%epilys%\" ) AND ((subject LIKE \"%lib%\" ) OR (subject LIKE \"%meli%\" ) ) ) ", |
12955 | + "(subject LIKE \"%github%\" ) OR ((_from LIKE \"%epilys%\" ) AND ((subject LIKE \"%lib%\" \ |
12956 | + ) OR (subject LIKE \"%meli%\" ) ) ) ", |
12957 | &query_to_sql( |
12958 | &query() |
12959 | .parse_complete( |
12960 | diff --git a/src/state.rs b/src/state.rs |
12961 | index b9e7aef..f917911 100644 |
12962 | --- a/src/state.rs |
12963 | +++ b/src/state.rs |
12964 | @@ -28,19 +28,16 @@ The UI crate has an Box<dyn Component>-Component-System design. The System part, |
12965 | Input is received in the main loop from threads which listen on the stdin for user input, observe folders for file changes etc. The relevant struct is `ThreadEvent`. |
12966 | */ |
12967 | |
12968 | - use super::*; |
12969 | - //use crate::plugins::PluginManager; |
12970 | - use melib::backends::{AccountHash, BackendEventConsumer}; |
12971 | + use std::{env, os::unix::io::RawFd, sync::Arc, thread}; |
12972 | |
12973 | - use crate::jobs::JobExecutor; |
12974 | - use crate::terminal::screen::Screen; |
12975 | use crossbeam::channel::{unbounded, Receiver, Sender}; |
12976 | use indexmap::IndexMap; |
12977 | + //use crate::plugins::PluginManager; |
12978 | + use melib::backends::{AccountHash, BackendEventConsumer}; |
12979 | use smallvec::SmallVec; |
12980 | - use std::env; |
12981 | - use std::os::unix::io::RawFd; |
12982 | - use std::sync::Arc; |
12983 | - use std::thread; |
12984 | + |
12985 | + use super::*; |
12986 | + use crate::{jobs::JobExecutor, terminal::screen::Screen}; |
12987 | |
12988 | struct InputHandler { |
12989 | pipe: (RawFd, RawFd), |
12990 | @@ -56,8 +53,8 @@ impl InputHandler { |
12991 | let control = Arc::downgrade(&working); |
12992 | |
12993 | /* Clear channel without blocking. switch_to_main_screen() issues a kill when |
12994 | - * returning from a fork and there's no input thread, so the newly created thread will |
12995 | - * receive it and die. */ |
12996 | + * returning from a fork and there's no input thread, so the newly created |
12997 | + * thread will receive it and die. */ |
12998 | //let _ = self.rx.try_iter().count(); |
12999 | let rx = self.rx.clone(); |
13000 | let pipe = self.pipe.0; |
13001 | @@ -228,8 +225,9 @@ impl Context { |
13002 | } |
13003 | } |
13004 | |
13005 | - /// A State object to manage and own components and components of the UI. `State` is responsible for |
13006 | - /// managing the terminal and interfacing with `melib` |
13007 | + /// A State object to manage and own components and components of the UI. |
13008 | + /// `State` is responsible for managing the terminal and interfacing with |
13009 | + /// `melib` |
13010 | pub struct State { |
13011 | screen: Box<Screen>, |
13012 | draw_rate_limit: RateLimit, |
13013 | @@ -284,9 +282,9 @@ impl State { |
13014 | receiver: Receiver<ThreadEvent>, |
13015 | ) -> Result<Self> { |
13016 | /* |
13017 | - * Create async channel to block the input-thread if we need to fork and stop it from reading |
13018 | - * stdin, see get_events() for details |
13019 | - * */ |
13020 | + * Create async channel to block the input-thread if we need to fork and stop |
13021 | + * it from reading stdin, see get_events() for details |
13022 | + */ |
13023 | let input_thread = unbounded(); |
13024 | let input_thread_pipe = nix::unistd::pipe() |
13025 | .map_err(|err| Box::new(err) as Box<dyn std::error::Error + Send + Sync + 'static>)?; |
13026 | @@ -434,7 +432,8 @@ impl State { |
13027 | /* |
13028 | * When we receive a mailbox hash from a watcher thread, |
13029 | * we match the hash to the index of the mailbox, request a reload |
13030 | - * and startup a thread to remind us to poll it every now and then till it's finished. |
13031 | + * and startup a thread to remind us to poll it every now and then till it's |
13032 | + * finished. |
13033 | */ |
13034 | pub fn refresh_event(&mut self, event: RefreshEvent) { |
13035 | let account_hash = event.account_hash; |
13036 | @@ -477,7 +476,8 @@ impl State { |
13037 | self.context.restore_input(); |
13038 | } |
13039 | |
13040 | - /// On `SIGWNICH` the `State` redraws itself according to the new terminal size. |
13041 | + /// On `SIGWNICH` the `State` redraws itself according to the new terminal |
13042 | + /// size. |
13043 | pub fn update_size(&mut self) { |
13044 | self.screen.update_size(); |
13045 | self.rcv_event(UIEvent::Resize); |
13046 | @@ -525,8 +525,8 @@ impl State { |
13047 | areas.sort_by(|a, b| (a.0).0.partial_cmp(&(b.0).0).unwrap()); |
13048 | |
13049 | if self.display_messages_active { |
13050 | - /* Check if any dirty area intersects with the area occupied by floating notification |
13051 | - * box */ |
13052 | + /* Check if any dirty area intersects with the area occupied by floating |
13053 | + * notification box */ |
13054 | let (displ_top, displ_bot) = self.display_messages_area; |
13055 | for &((top_x, top_y), (bottom_x, bottom_y)) in &areas { |
13056 | self.display_messages_dirty |= !(bottom_y < displ_top.1 |
13057 | @@ -992,34 +992,51 @@ impl State { |
13058 | ))); |
13059 | } else if let Action::ReloadConfiguration = action { |
13060 | match Settings::new().and_then(|new_settings| { |
13061 | - let old_accounts = self.context.settings.accounts.keys().collect::<std::collections::HashSet<&String>>(); |
13062 | - let new_accounts = new_settings.accounts.keys().collect::<std::collections::HashSet<&String>>(); |
13063 | + let old_accounts = self |
13064 | + .context |
13065 | + .settings |
13066 | + .accounts |
13067 | + .keys() |
13068 | + .collect::<std::collections::HashSet<&String>>(); |
13069 | + let new_accounts = new_settings |
13070 | + .accounts |
13071 | + .keys() |
13072 | + .collect::<std::collections::HashSet<&String>>(); |
13073 | if old_accounts != new_accounts { |
13074 | - return Err("cannot reload account configuration changes; restart meli instead.".into()); |
13075 | + return Err("cannot reload account configuration changes; \ |
13076 | + restart meli instead." |
13077 | + .into()); |
13078 | } |
13079 | for (key, acc) in new_settings.accounts.iter() { |
13080 | - if toml::Value::try_from(&acc) != toml::Value::try_from(&self.context.settings.accounts[key]) { |
13081 | - return Err("cannot reload account configuration changes; restart meli instead.".into()); |
13082 | + if toml::Value::try_from(acc) |
13083 | + != toml::Value::try_from(&self.context.settings.accounts[key]) |
13084 | + { |
13085 | + return Err("cannot reload account configuration changes; \ |
13086 | + restart meli instead." |
13087 | + .into()); |
13088 | } |
13089 | } |
13090 | - if toml::Value::try_from(&new_settings) == toml::Value::try_from(&self.context.settings) { |
13091 | + if toml::Value::try_from(&new_settings) |
13092 | + == toml::Value::try_from(&self.context.settings) |
13093 | + { |
13094 | return Err("No changes detected.".into()); |
13095 | } |
13096 | Ok(Box::new(new_settings)) |
13097 | }) { |
13098 | Ok(new_settings) => { |
13099 | - let old_settings = std::mem::replace(&mut self.context.settings, new_settings); |
13100 | - self.context.replies.push_back(UIEvent::ConfigReload { |
13101 | - old_settings |
13102 | - }); |
13103 | + let old_settings = |
13104 | + std::mem::replace(&mut self.context.settings, new_settings); |
13105 | + self.context |
13106 | + .replies |
13107 | + .push_back(UIEvent::ConfigReload { old_settings }); |
13108 | self.context.replies.push_back(UIEvent::Resize); |
13109 | } |
13110 | Err(err) => { |
13111 | self.context.replies.push_back(UIEvent::StatusEvent( |
13112 | - StatusEvent::DisplayMessage(format!( |
13113 | - "Could not load configuration: {}", |
13114 | - err |
13115 | - )), |
13116 | + StatusEvent::DisplayMessage(format!( |
13117 | + "Could not load configuration: {}", |
13118 | + err |
13119 | + )), |
13120 | )); |
13121 | } |
13122 | } |
13123 | @@ -1221,8 +1238,8 @@ impl State { |
13124 | } |
13125 | Some(false) |
13126 | } |
13127 | - /// Switch back to the terminal's main screen (The command line the user sees before opening |
13128 | - /// the application) |
13129 | + /// Switch back to the terminal's main screen (The command line the user |
13130 | + /// sees before opening the application) |
13131 | pub fn switch_to_main_screen(&mut self) { |
13132 | self.screen.switch_to_main_screen(); |
13133 | } |
13134 | diff --git a/src/terminal.rs b/src/terminal.rs |
13135 | index 916c77f..46f0f63 100644 |
13136 | --- a/src/terminal.rs |
13137 | +++ b/src/terminal.rs |
13138 | @@ -22,8 +22,7 @@ |
13139 | /*! Terminal grid cells, keys, colors, etc. |
13140 | */ |
13141 | extern crate serde; |
13142 | - use self::serde::de::Visitor; |
13143 | - use self::serde::{de, Deserialize, Deserializer}; |
13144 | + use self::serde::{de, de::Visitor, Deserialize, Deserializer}; |
13145 | extern crate unicode_segmentation; |
13146 | |
13147 | mod color; |
13148 | @@ -36,12 +35,9 @@ mod cells; |
13149 | mod keys; |
13150 | pub mod embed; |
13151 | mod text_editing; |
13152 | - pub use self::cells::*; |
13153 | - pub use self::keys::*; |
13154 | - pub use self::position::*; |
13155 | - pub use self::text_editing::*; |
13156 | - |
13157 | use std::fmt; |
13158 | + |
13159 | + pub use self::{cells::*, keys::*, position::*, text_editing::*}; |
13160 | /* |
13161 | * CSI events we use |
13162 | */ |
13163 | @@ -101,12 +97,14 @@ derive_csi_sequence!( |
13164 | ); |
13165 | |
13166 | derive_csi_sequence!( |
13167 | - #[doc = "`CSI Ps ; Ps ; Ps t`, where `Ps = 2 2 ; 0` -> Save xterm icon and window title on stack."] |
13168 | + #[doc = "`CSI Ps ; Ps ; Ps t`, where `Ps = 2 2 ; 0` -> Save xterm icon and window title on \ |
13169 | + stack."] |
13170 | (SaveWindowTitleIconToStack, "22;0t") |
13171 | ); |
13172 | |
13173 | derive_csi_sequence!( |
13174 | - #[doc = "Restore window title and icon from terminal's title stack. `CSI Ps ; Ps ; Ps t`, where `Ps = 2 3 ; 0` -> Restore xterm icon and window title from stack."] |
13175 | + #[doc = "Restore window title and icon from terminal's title stack. `CSI Ps ; Ps ; Ps t`, \ |
13176 | + where `Ps = 2 3 ; 0` -> Restore xterm icon and window title from stack."] |
13177 | (RestoreWindowTitleIconFromStack, "23;0t") |
13178 | ); |
13179 | |
13180 | @@ -284,9 +282,10 @@ mod braille { |
13181 | } |
13182 | */ |
13183 | |
13184 | - /// Iterate on 2x4 pixel blocks from a bitmap and return a unicode braille character for each |
13185 | - /// block. The iterator holds four lines of bitmaps encoded as `u16` numbers in swapped bit |
13186 | - /// order, like the `xbm` graphics format. The bitmap is split to `u16` columns. |
13187 | + /// Iterate on 2x4 pixel blocks from a bitmap and return a unicode braille |
13188 | + /// character for each block. The iterator holds four lines of bitmaps |
13189 | + /// encoded as `u16` numbers in swapped bit order, like the `xbm` |
13190 | + /// graphics format. The bitmap is split to `u16` columns. |
13191 | /// |
13192 | /// ## Usage |
13193 | /// ```no_run |
13194 | @@ -339,6 +338,7 @@ mod braille { |
13195 | /// |
13196 | /// ## Explanation: |
13197 | /// For the following bitmap: |
13198 | + /// |
13199 | /// ```text |
13200 | /// ◻◼◻◻◼◻◻◼◻◻◻◼◼◼◼◼ |
13201 | /// ◼◼◼◼◼◼◻◻◼◻◼◻◻◼◼◼ |
13202 | @@ -347,6 +347,7 @@ mod braille { |
13203 | /// ``` |
13204 | /// |
13205 | /// Iteration on each step examines two columns: |
13206 | + /// |
13207 | /// ```text |
13208 | /// ⇩⇩ |
13209 | /// ◻◼┆◻◻┆◼◻┆◻◼┆◻◻┆◻◼┆◼◼┆◼◼ |
13210 | @@ -355,7 +356,7 @@ mod braille { |
13211 | /// ◼◻┆◼◼┆◻◼┆◼◻┆◼◼┆◼◻┆◻◻┆◻◻ |
13212 | /// ``` |
13213 | /// |
13214 | - /// The first two columns are encoded as: |
13215 | + /// The first two columns are encoded as: |
13216 | /// |
13217 | /// ```text |
13218 | /// ┏━━━━━━┳━━━━┓ |
13219 | @@ -371,12 +372,16 @@ mod braille { |
13220 | /// ◻◼◻◼◼◻◼◻ = 0b01011010 = 0x5A |
13221 | /// 12345678 |
13222 | /// ``` |
13223 | - /// and braille character is bitmap + 0x2800 (Braille block's position in Unicode) |
13224 | + /// |
13225 | + /// and braille character is bitmap + 0x2800 (Braille block's position in |
13226 | + /// Unicode) |
13227 | + /// |
13228 | /// ```text |
13229 | /// 0x5A + 0x2800 = 0x285A = '⡚' |
13230 | /// ``` |
13231 | /// |
13232 | - /// Why three columns? I originally wrote this for X-Face bitmaps, which are 48x48 pixels. |
13233 | + /// Why three columns? I originally wrote this for X-Face bitmaps, which are |
13234 | + /// 48x48 pixels. |
13235 | pub struct BraillePixelIter { |
13236 | columns: [Braille16bitColumn; 3], |
13237 | column_ptr: usize, |
13238 | @@ -445,8 +450,9 @@ mod braille { |
13239 | bits += (0x1 & (bitmaps.3.rotate_left(*bitcolumn))) * 0x80; |
13240 | *bitcolumn += 1; |
13241 | |
13242 | - /* The Braille Patterns block spans the entire [U+2800, U+28FF] range and bits is a |
13243 | - * 16bit integer ∈ [0x00, 0xFF] so this is guaranteed to be a Unicode char */ |
13244 | + /* The Braille Patterns block spans the entire [U+2800, U+28FF] range and |
13245 | + * bits is a 16bit integer ∈ [0x00, 0xFF] so this is guaranteed |
13246 | + * to be a Unicode char */ |
13247 | Some(unsafe { std::char::from_u32_unchecked(bits as u32 + 0x2800) }) |
13248 | } |
13249 | } |
13250 | @@ -454,13 +460,12 @@ mod braille { |
13251 | |
13252 | pub use screen::StateStdout; |
13253 | pub mod screen { |
13254 | - use super::*; |
13255 | + use std::io::{BufWriter, Write}; |
13256 | + |
13257 | use cells::CellBuffer; |
13258 | - use std::io::BufWriter; |
13259 | - use std::io::Write; |
13260 | - use termion::raw::IntoRawMode; |
13261 | - use termion::screen::AlternateScreen; |
13262 | - use termion::{clear, cursor}; |
13263 | + use termion::{clear, cursor, raw::IntoRawMode, screen::AlternateScreen}; |
13264 | + |
13265 | + use super::*; |
13266 | pub type StateStdout = |
13267 | termion::screen::AlternateScreen<termion::raw::RawTerminal<BufWriter<std::io::Stdout>>>; |
13268 | |
13269 | @@ -476,8 +481,8 @@ pub mod screen { |
13270 | } |
13271 | |
13272 | impl Screen { |
13273 | - /// Switch back to the terminal's main screen (The command line the user sees before opening |
13274 | - /// the application) |
13275 | + /// Switch back to the terminal's main screen (The command line the user |
13276 | + /// sees before opening the application) |
13277 | pub fn switch_to_main_screen(&mut self) { |
13278 | let mouse = self.mouse; |
13279 | write!( |
13280 | @@ -554,7 +559,8 @@ pub mod screen { |
13281 | } |
13282 | self.flush(); |
13283 | } |
13284 | - /// On `SIGWNICH` the `State` redraws itself according to the new terminal size. |
13285 | + /// On `SIGWNICH` the `State` redraws itself according to the new |
13286 | + /// terminal size. |
13287 | pub fn update_size(&mut self) { |
13288 | let termsize = termion::terminal_size().ok(); |
13289 | let termcols = termsize.map(|(w, _)| w); |
13290 | diff --git a/src/terminal/cells.rs b/src/terminal/cells.rs |
13291 | index 20f239e..45b04d6 100644 |
13292 | --- a/src/terminal/cells.rs |
13293 | +++ b/src/terminal/cells.rs |
13294 | @@ -24,23 +24,25 @@ |
13295 | colors and attributes. |
13296 | */ |
13297 | |
13298 | - use super::{position::*, Color}; |
13299 | - use crate::state::Context; |
13300 | - use crate::ThemeAttribute; |
13301 | - use melib::text_processing::wcwidth; |
13302 | + use std::{ |
13303 | + collections::HashMap, |
13304 | + convert::From, |
13305 | + fmt, |
13306 | + ops::{Deref, DerefMut, Index, IndexMut}, |
13307 | + }; |
13308 | |
13309 | + use melib::text_processing::wcwidth; |
13310 | use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; |
13311 | use smallvec::SmallVec; |
13312 | - use std::collections::HashMap; |
13313 | - use std::convert::From; |
13314 | - use std::fmt; |
13315 | - use std::ops::{Deref, DerefMut, Index, IndexMut}; |
13316 | |
13317 | - /// In a scroll region up and down cursor movements shift the region vertically. The new lines are |
13318 | - /// empty. |
13319 | + use super::{position::*, Color}; |
13320 | + use crate::{state::Context, ThemeAttribute}; |
13321 | + |
13322 | + /// In a scroll region up and down cursor movements shift the region vertically. |
13323 | + /// The new lines are empty. |
13324 | /// |
13325 | - /// See `CellBuffer::scroll_up` and `CellBuffer::scroll_down` for an explanation of how `xterm` |
13326 | - /// scrolling works. |
13327 | + /// See `CellBuffer::scroll_up` and `CellBuffer::scroll_down` for an explanation |
13328 | + /// of how `xterm` scrolling works. |
13329 | #[derive(Debug, Clone, PartialEq, Eq, Default)] |
13330 | pub struct ScrollRegion { |
13331 | pub top: usize, |
13332 | @@ -51,11 +53,12 @@ pub struct ScrollRegion { |
13333 | |
13334 | /// An array of `Cell`s that represents a terminal display. |
13335 | /// |
13336 | - /// A `CellBuffer` is a two-dimensional array of `Cell`s, each pair of indices correspond to a |
13337 | - /// single point on the underlying terminal. |
13338 | + /// A `CellBuffer` is a two-dimensional array of `Cell`s, each pair of indices |
13339 | + /// correspond to a single point on the underlying terminal. |
13340 | /// |
13341 | - /// The first index, `Cellbuffer[y]`, corresponds to a row, and thus the y-axis. The second |
13342 | - /// index, `Cellbuffer[y][x]`, corresponds to a column within a row and thus the x-axis. |
13343 | + /// The first index, `Cellbuffer[y]`, corresponds to a row, and thus the y-axis. |
13344 | + /// The second index, `Cellbuffer[y][x]`, corresponds to a column within a row |
13345 | + /// and thus the x-axis. |
13346 | #[derive(Clone, PartialEq, Eq)] |
13347 | pub struct CellBuffer { |
13348 | pub cols: usize, |
13349 | @@ -97,8 +100,8 @@ impl CellBuffer { |
13350 | self.cols = new_cols; |
13351 | } |
13352 | |
13353 | - /// Constructs a new `CellBuffer` with the given number of columns and rows, using the given |
13354 | - /// `cell` as a blank. |
13355 | + /// Constructs a new `CellBuffer` with the given number of columns and rows, |
13356 | + /// using the given `cell` as a blank. |
13357 | pub fn new(cols: usize, rows: usize, default_cell: Cell) -> CellBuffer { |
13358 | CellBuffer { |
13359 | cols, |
13360 | @@ -146,8 +149,8 @@ impl CellBuffer { |
13361 | self.growable = new_val; |
13362 | } |
13363 | |
13364 | - /// Resizes `CellBuffer` to the given number of rows and columns, using the given `Cell` as |
13365 | - /// a blank. |
13366 | + /// Resizes `CellBuffer` to the given number of rows and columns, using the |
13367 | + /// given `Cell` as a blank. |
13368 | #[must_use] |
13369 | pub fn resize(&mut self, newcols: usize, newrows: usize, blank: Option<Cell>) -> bool { |
13370 | let newlen = newcols * newrows; |
13371 | @@ -196,8 +199,8 @@ impl CellBuffer { |
13372 | } |
13373 | } |
13374 | |
13375 | - /// Returns a reference to the `Cell` at the given coordinates, or `None` if the index is out of |
13376 | - /// bounds. |
13377 | + /// Returns a reference to the `Cell` at the given coordinates, or `None` if |
13378 | + /// the index is out of bounds. |
13379 | pub fn get(&self, x: usize, y: usize) -> Option<&Cell> { |
13380 | match self.pos_to_index(x, y) { |
13381 | Some(i) => self.cellvec().get(i), |
13382 | @@ -205,8 +208,8 @@ impl CellBuffer { |
13383 | } |
13384 | } |
13385 | |
13386 | - /// Returns a mutable reference to the `Cell` at the given coordinates, or `None` if the index |
13387 | - /// is out of bounds. |
13388 | + /// Returns a mutable reference to the `Cell` at the given coordinates, or |
13389 | + /// `None` if the index is out of bounds. |
13390 | pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut Cell> { |
13391 | match self.pos_to_index(x, y) { |
13392 | Some(i) => self.cellvec_mut().get_mut(i), |
13393 | @@ -271,7 +274,6 @@ impl CellBuffer { |
13394 | /// | 555555555555 | | 666666666666 | |
13395 | /// | 666666666666 | | | |
13396 | /// ``` |
13397 | - /// |
13398 | pub fn scroll_up(&mut self, scroll_region: &ScrollRegion, top: usize, offset: usize) { |
13399 | //debug!( |
13400 | // "scroll_up scroll_region {:?}, top: {} offset {}", |
13401 | @@ -334,7 +336,6 @@ impl CellBuffer { |
13402 | /// | 555555555555 | | 444444444444 | |
13403 | /// | 666666666666 | | 555555555555 | |
13404 | /// ``` |
13405 | - /// |
13406 | pub fn scroll_down(&mut self, scroll_region: &ScrollRegion, top: usize, offset: usize) { |
13407 | //debug!( |
13408 | // "scroll_down scroll_region {:?}, top: {} offset {}", |
13409 | @@ -409,8 +410,10 @@ impl CellBuffer { |
13410 | } |
13411 | |
13412 | pub fn insert_tag(&mut self, tag: FormatTag) -> u64 { |
13413 | - use std::collections::hash_map::DefaultHasher; |
13414 | - use std::hash::{Hash, Hasher}; |
13415 | + use std::{ |
13416 | + collections::hash_map::DefaultHasher, |
13417 | + hash::{Hash, Hasher}, |
13418 | + }; |
13419 | |
13420 | let mut hasher = DefaultHasher::new(); |
13421 | tag.hash(&mut hasher); |
13422 | @@ -463,7 +466,8 @@ impl IndexMut<Pos> for CellBuffer { |
13423 | } |
13424 | |
13425 | impl Default for CellBuffer { |
13426 | - /// Constructs a new `CellBuffer` with a size of `(0, 0)`, using the default `Cell` as a blank. |
13427 | + /// Constructs a new `CellBuffer` with a size of `(0, 0)`, using the default |
13428 | + /// `Cell` as a blank. |
13429 | fn default() -> CellBuffer { |
13430 | CellBuffer::new(0, 0, Cell::default()) |
13431 | } |
13432 | @@ -491,8 +495,8 @@ impl fmt::Display for CellBuffer { |
13433 | pub struct Cell { |
13434 | ch: char, |
13435 | |
13436 | - /// Set a `Cell` as empty when a previous cell spans multiple columns and it would |
13437 | - /// "overflow" to this cell. |
13438 | + /// Set a `Cell` as empty when a previous cell spans multiple columns and it |
13439 | + /// would "overflow" to this cell. |
13440 | empty: bool, |
13441 | fg: Color, |
13442 | bg: Color, |
13443 | @@ -508,7 +512,7 @@ impl Cell { |
13444 | /// # Examples |
13445 | /// |
13446 | /// ```no_run |
13447 | - /// use meli::{Color, Attr, Cell}; |
13448 | + /// use meli::{Attr, Cell, Color}; |
13449 | /// |
13450 | /// let cell = Cell::new('x', Color::Default, Color::Green, Attr::DEFAULT); |
13451 | /// assert_eq!(cell.ch(), 'x'); |
13452 | @@ -534,7 +538,7 @@ impl Cell { |
13453 | /// # Examples |
13454 | /// |
13455 | /// ```no_run |
13456 | - /// use meli::{Color, Attr, Cell}; |
13457 | + /// use meli::{Attr, Cell, Color}; |
13458 | /// |
13459 | /// let mut cell = Cell::with_char('x'); |
13460 | /// assert_eq!(cell.ch(), 'x'); |
13461 | @@ -551,7 +555,7 @@ impl Cell { |
13462 | /// # Examples |
13463 | /// |
13464 | /// ```no_run |
13465 | - /// use meli::{Color, Attr, Cell}; |
13466 | + /// use meli::{Attr, Cell, Color}; |
13467 | /// |
13468 | /// let mut cell = Cell::with_style(Color::Default, Color::Red, Attr::BOLD); |
13469 | /// assert_eq!(cell.fg(), Color::Default); |
13470 | @@ -603,7 +607,7 @@ impl Cell { |
13471 | /// # Examples |
13472 | /// |
13473 | /// ```no_run |
13474 | - /// use meli::{Color, Attr, Cell}; |
13475 | + /// use meli::{Attr, Cell, Color}; |
13476 | /// |
13477 | /// let mut cell = Cell::with_style(Color::Blue, Color::Default, Attr::DEFAULT); |
13478 | /// assert_eq!(cell.fg(), Color::Blue); |
13479 | @@ -617,7 +621,7 @@ impl Cell { |
13480 | /// # Examples |
13481 | /// |
13482 | /// ```no_run |
13483 | - /// use meli::{Color, Cell}; |
13484 | + /// use meli::{Cell, Color}; |
13485 | /// |
13486 | /// let mut cell = Cell::default(); |
13487 | /// assert_eq!(cell.fg(), Color::Default); |
13488 | @@ -637,7 +641,7 @@ impl Cell { |
13489 | /// # Examples |
13490 | /// |
13491 | /// ```no_run |
13492 | - /// use meli::{Attr, Color, Cell}; |
13493 | + /// use meli::{Attr, Cell, Color}; |
13494 | /// |
13495 | /// let mut cell = Cell::with_style(Color::Default, Color::Green, Attr::DEFAULT); |
13496 | /// assert_eq!(cell.bg(), Color::Green); |
13497 | @@ -677,8 +681,8 @@ impl Cell { |
13498 | self |
13499 | } |
13500 | |
13501 | - /// Set a `Cell` as empty when a previous cell spans multiple columns and it would |
13502 | - /// "overflow" to this cell. |
13503 | + /// Set a `Cell` as empty when a previous cell spans multiple columns and it |
13504 | + /// would "overflow" to this cell. |
13505 | pub fn empty(&self) -> bool { |
13506 | self.empty |
13507 | } |
13508 | @@ -688,22 +692,23 @@ impl Cell { |
13509 | self |
13510 | } |
13511 | |
13512 | - /// Sets `keep_fg` field. If true, the foreground color will not be altered if attempted so |
13513 | - /// until the character content of the cell is changed. |
13514 | + /// Sets `keep_fg` field. If true, the foreground color will not be altered |
13515 | + /// if attempted so until the character content of the cell is changed. |
13516 | pub fn set_keep_fg(&mut self, new_val: bool) -> &mut Cell { |
13517 | self.keep_fg = new_val; |
13518 | self |
13519 | } |
13520 | |
13521 | - /// Sets `keep_bg` field. If true, the background color will not be altered if attempted so |
13522 | - /// until the character content of the cell is changed. |
13523 | + /// Sets `keep_bg` field. If true, the background color will not be altered |
13524 | + /// if attempted so until the character content of the cell is changed. |
13525 | pub fn set_keep_bg(&mut self, new_val: bool) -> &mut Cell { |
13526 | self.keep_bg = new_val; |
13527 | self |
13528 | } |
13529 | |
13530 | - /// Sets `keep_attrs` field. If true, the text attributes will not be altered if attempted so |
13531 | - /// until the character content of the cell is changed. |
13532 | + /// Sets `keep_attrs` field. If true, the text attributes will not be |
13533 | + /// altered if attempted so until the character content of the cell is |
13534 | + /// changed. |
13535 | pub fn set_keep_attrs(&mut self, new_val: bool) -> &mut Cell { |
13536 | self.keep_attrs = new_val; |
13537 | self |
13538 | @@ -716,7 +721,7 @@ impl Default for Cell { |
13539 | /// # Examples |
13540 | /// |
13541 | /// ```no_run |
13542 | - /// use meli::{Color, Cell}; |
13543 | + /// use meli::{Cell, Color}; |
13544 | /// |
13545 | /// let mut cell = Cell::default(); |
13546 | /// assert_eq!(cell.ch(), ' '); |
13547 | @@ -1125,7 +1130,8 @@ macro_rules! inspect_bounds { |
13548 | }; |
13549 | } |
13550 | |
13551 | - /// Write an `&str` to a `CellBuffer` in a specified `Area` with the passed colors. |
13552 | + /// Write an `&str` to a `CellBuffer` in a specified `Area` with the passed |
13553 | + /// colors. |
13554 | pub fn write_string_to_grid( |
13555 | s: &str, |
13556 | grid: &mut CellBuffer, |
13557 | @@ -1225,7 +1231,8 @@ pub fn write_string_to_grid( |
13558 | (x, y) |
13559 | } |
13560 | |
13561 | - /// Completely clear an `Area` with an empty char and the terminal's default colors. |
13562 | + /// Completely clear an `Area` with an empty char and the terminal's default |
13563 | + /// colors. |
13564 | pub fn clear_area(grid: &mut CellBuffer, area: Area, attributes: crate::conf::ThemeAttribute) { |
13565 | if !is_valid_area!(area) { |
13566 | return; |
13567 | @@ -1241,17 +1248,14 @@ pub fn clear_area(grid: &mut CellBuffer, area: Area, attributes: crate::conf::Th |
13568 | } |
13569 | } |
13570 | |
13571 | - /// Use `RowIterator` to iterate the cells of a row without the need to do any bounds checking; |
13572 | - /// the iterator will simply return `None` when it reaches the end of the row. |
13573 | - /// `RowIterator` can be created via the `CellBuffer::row_iter` method and can be returned by |
13574 | - /// `BoundsIterator` which iterates each row. |
13575 | + /// Use `RowIterator` to iterate the cells of a row without the need to do any |
13576 | + /// bounds checking; the iterator will simply return `None` when it reaches the |
13577 | + /// end of the row. `RowIterator` can be created via the `CellBuffer::row_iter` |
13578 | + /// method and can be returned by `BoundsIterator` which iterates each row. |
13579 | /// ```no_run |
13580 | /// # let mut grid = meli::CellBuffer::new(1, 1, meli::Cell::default()); |
13581 | /// # let x = 0; |
13582 | - /// for c in grid.row_iter( |
13583 | - /// x..(x + 11), |
13584 | - /// 0, |
13585 | - /// ) { |
13586 | + /// for c in grid.row_iter(x..(x + 11), 0) { |
13587 | /// grid[c].set_ch('w'); |
13588 | /// } |
13589 | /// ``` |
13590 | @@ -1268,8 +1272,8 @@ pub struct RowIterator { |
13591 | /// # let area = ((0, 0), (1, 1)); |
13592 | /// /* Visit each `Cell` in `area`. */ |
13593 | /// for row in grid.bounds_iter(area) { |
13594 | - /// for c in row { |
13595 | - /// grid[c].set_ch('w'); |
13596 | + /// for c in row { |
13597 | + /// grid[c].set_ch('w'); |
13598 | /// } |
13599 | /// } |
13600 | /// ``` |
13601 | diff --git a/src/terminal/color.rs b/src/terminal/color.rs |
13602 | index cc32ebc..67f33aa 100644 |
13603 | --- a/src/terminal/color.rs |
13604 | +++ b/src/terminal/color.rs |
13605 | @@ -26,9 +26,9 @@ use termion::color::{AnsiValue, Rgb as TermionRgb}; |
13606 | /// |
13607 | /// `Color::Default` represents the default color of the underlying terminal. |
13608 | /// |
13609 | - /// The eight basic colors may be used directly and correspond to 0x00..0x07 in the 8-bit (256) |
13610 | - /// color range; in addition, the eight basic colors coupled with `Attr::BOLD` correspond to |
13611 | - /// 0x08..0x0f in the 8-bit color range. |
13612 | + /// The eight basic colors may be used directly and correspond to 0x00..0x07 in |
13613 | + /// the 8-bit (256) color range; in addition, the eight basic colors coupled |
13614 | + /// with `Attr::BOLD` correspond to 0x08..0x0f in the 8-bit color range. |
13615 | /// |
13616 | /// `Color::Byte(..)` may be used to specify a color in the 8-bit range. |
13617 | /// |
13618 | @@ -49,7 +49,7 @@ use termion::color::{AnsiValue, Rgb as TermionRgb}; |
13619 | /// // Basic colors are also 8-bit colors (but not vice-versa). |
13620 | /// assert_eq!(red.as_byte(), fancy.as_byte()) |
13621 | /// ``` |
13622 | - #[derive(Hash, Debug, Copy, Clone, PartialEq, Eq)] |
13623 | + #[derive(Hash, Debug, Copy, Clone, PartialEq, Eq, Default)] |
13624 | pub enum Color { |
13625 | Black, |
13626 | Red, |
13627 | @@ -62,6 +62,7 @@ pub enum Color { |
13628 | Byte(u8), |
13629 | Rgb(u8, u8, u8), |
13630 | /// Terminal default. |
13631 | + #[default] |
13632 | Default, |
13633 | } |
13634 | |
13635 | @@ -396,9 +397,7 @@ impl Color { |
13636 | s if s.starts_with('#') |
13637 | && s.len() == 7 |
13638 | && s[1..].as_bytes().iter().all(|&b| { |
13639 | - (b'0'..=b'9').contains(&b) |
13640 | - || (b'a'..=b'f').contains(&b) |
13641 | - || (b'A'..=b'F').contains(&b) |
13642 | + b.is_ascii_digit() || (b'a'..=b'f').contains(&b) || (b'A'..=b'F').contains(&b) |
13643 | }) => |
13644 | { |
13645 | return Ok(Color::Rgb( |
13646 | @@ -413,9 +412,7 @@ impl Color { |
13647 | s if s.starts_with('#') |
13648 | && s.len() == 4 |
13649 | && s[1..].as_bytes().iter().all(|&b| { |
13650 | - (b'0'..=b'9').contains(&b) |
13651 | - || (b'a'..=b'f').contains(&b) |
13652 | - || (b'A'..=b'F').contains(&b) |
13653 | + b.is_ascii_digit() || (b'a'..=b'f').contains(&b) || (b'A'..=b'F').contains(&b) |
13654 | }) => |
13655 | { |
13656 | return Ok(Color::Rgb( |
13657 | @@ -435,12 +432,6 @@ impl Color { |
13658 | } |
13659 | } |
13660 | |
13661 | - impl Default for Color { |
13662 | - fn default() -> Self { |
13663 | - Color::Default |
13664 | - } |
13665 | - } |
13666 | - |
13667 | impl<'de> Deserialize<'de> for Color { |
13668 | fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error> |
13669 | where |
13670 | diff --git a/src/terminal/embed.rs b/src/terminal/embed.rs |
13671 | index d988841..2e4b2b1 100644 |
13672 | --- a/src/terminal/embed.rs |
13673 | +++ b/src/terminal/embed.rs |
13674 | @@ -19,44 +19,48 @@ |
13675 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
13676 | */ |
13677 | |
13678 | - use crate::terminal::position::*; |
13679 | - use melib::{error::*, log, ERROR}; |
13680 | - use smallvec::SmallVec; |
13681 | + use std::{ |
13682 | + ffi::{CString, OsStr}, |
13683 | + os::unix::{ |
13684 | + ffi::OsStrExt, |
13685 | + io::{AsRawFd, FromRawFd, IntoRawFd}, |
13686 | + }, |
13687 | + }; |
13688 | |
13689 | + use melib::{error::*, log, ERROR}; |
13690 | #[cfg(not(target_os = "macos"))] |
13691 | use nix::{ |
13692 | fcntl::{open, OFlag}, |
13693 | pty::{grantpt, posix_openpt, ptsname, unlockpt}, |
13694 | sys::stat, |
13695 | }; |
13696 | - |
13697 | - use nix::libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}; |
13698 | - use nix::pty::Winsize; |
13699 | - use nix::unistd::{dup2, fork, ForkResult}; |
13700 | - use nix::{ioctl_none_bad, ioctl_write_ptr_bad}; |
13701 | - use std::ffi::{CString, OsStr}; |
13702 | - use std::os::unix::{ |
13703 | - ffi::OsStrExt, |
13704 | - io::{AsRawFd, FromRawFd, IntoRawFd}, |
13705 | + use nix::{ |
13706 | + ioctl_none_bad, ioctl_write_ptr_bad, |
13707 | + libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}, |
13708 | + pty::Winsize, |
13709 | + unistd::{dup2, fork, ForkResult}, |
13710 | }; |
13711 | + use smallvec::SmallVec; |
13712 | + |
13713 | + use crate::terminal::position::*; |
13714 | |
13715 | mod grid; |
13716 | |
13717 | - pub use grid::{EmbedGrid, EmbedTerminal}; |
13718 | + #[cfg(not(target_os = "macos"))] |
13719 | + use std::path::Path; |
13720 | + use std::{ |
13721 | + convert::TryFrom, |
13722 | + io::{Read, Write}, |
13723 | + sync::{Arc, Mutex}, |
13724 | + }; |
13725 | |
13726 | - // ioctl request code to "Make the given terminal the controlling terminal of the calling process" |
13727 | + pub use grid::{EmbedGrid, EmbedTerminal}; |
13728 | + // ioctl request code to "Make the given terminal the controlling terminal of the calling |
13729 | + // process" |
13730 | use libc::TIOCSCTTY; |
13731 | // ioctl request code to set window size of pty: |
13732 | use libc::TIOCSWINSZ; |
13733 | |
13734 | - #[cfg(not(target_os = "macos"))] |
13735 | - use std::path::Path; |
13736 | - |
13737 | - use std::convert::TryFrom; |
13738 | - use std::io::Read; |
13739 | - use std::io::Write; |
13740 | - use std::sync::{Arc, Mutex}; |
13741 | - |
13742 | // Macro generated function that calls ioctl to set window size of slave pty end |
13743 | ioctl_write_ptr_bad!(set_window_size, TIOCSWINSZ, Winsize); |
13744 | |
13745 | @@ -142,7 +146,7 @@ pub fn create_pty( |
13746 | } |
13747 | /* Find posix sh location, because POSIX shell is not always at /bin/sh */ |
13748 | let path_var = std::process::Command::new("getconf") |
13749 | - .args(&["PATH"]) |
13750 | + .args(["PATH"]) |
13751 | .output()? |
13752 | .stdout; |
13753 | for mut p in std::env::split_paths(&OsStr::from_bytes(&path_var[..])) { |
13754 | @@ -273,9 +277,7 @@ impl std::fmt::Display for EscCode<'_> { |
13755 | unsafestr!(buf2), |
13756 | *c as char |
13757 | ), |
13758 | - EscCode(ExpectingControlChar, b'D') => write!( |
13759 | - f, "ESC D Linefeed" |
13760 | - ), |
13761 | + EscCode(ExpectingControlChar, b'D') => write!(f, "ESC D Linefeed"), |
13762 | EscCode(Csi, b'm') => write!( |
13763 | f, |
13764 | "ESC[m\t\tCSI Character Attributes | Set Attr and Color to Normal (default)" |
13765 | @@ -284,14 +286,8 @@ impl std::fmt::Display for EscCode<'_> { |
13766 | f, |
13767 | "ESC[K\t\tCSI Erase from the cursor to the end of the line" |
13768 | ), |
13769 | - EscCode(Csi, b'L') => write!( |
13770 | - f, |
13771 | - "ESC[L\t\tCSI Insert one blank line" |
13772 | - ), |
13773 | - EscCode(Csi, b'M') => write!( |
13774 | - f, |
13775 | - "ESC[M\t\tCSI delete line" |
13776 | - ), |
13777 | + EscCode(Csi, b'L') => write!(f, "ESC[L\t\tCSI Insert one blank line"), |
13778 | + EscCode(Csi, b'M') => write!(f, "ESC[M\t\tCSI delete line"), |
13779 | EscCode(Csi, b'J') => write!( |
13780 | f, |
13781 | "ESC[J\t\tCSI Erase from the cursor to the end of the screen" |
13782 | @@ -368,17 +364,16 @@ impl std::fmt::Display for EscCode<'_> { |
13783 | "ESC[{buf}S\t\tCSI P s S Scroll up P s lines (default = 1) (SU), VT420, EC", |
13784 | buf = unsafestr!(buf) |
13785 | ), |
13786 | - EscCode(Csi1(ref buf), b'J') => write!( |
13787 | - f, |
13788 | - "Erase in display {buf}", |
13789 | - buf = unsafestr!(buf) |
13790 | - ), |
13791 | + EscCode(Csi1(ref buf), b'J') => { |
13792 | + write!(f, "Erase in display {buf}", buf = unsafestr!(buf)) |
13793 | + } |
13794 | EscCode(Csi1(ref buf), c) => { |
13795 | write!(f, "ESC[{}{}\t\tCSI [UNKNOWN]", unsafestr!(buf), *c as char) |
13796 | } |
13797 | EscCode(Csi2(ref buf1, ref buf2), b'r') => write!( |
13798 | f, |
13799 | - "ESC[{};{}r\t\tCSI Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM), VT100.", |
13800 | + "ESC[{};{}r\t\tCSI Set Scrolling Region [top;bottom] (default = full size of \ |
13801 | + window) (DECSTBM), VT100.", |
13802 | unsafestr!(buf1), |
13803 | unsafestr!(buf2), |
13804 | ), |
13805 | diff --git a/src/terminal/embed/grid.rs b/src/terminal/embed/grid.rs |
13806 | index 1e5cfc8..2785d48 100644 |
13807 | --- a/src/terminal/embed/grid.rs |
13808 | +++ b/src/terminal/embed/grid.rs |
13809 | @@ -19,12 +19,14 @@ |
13810 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
13811 | */ |
13812 | |
13813 | + use melib::{ |
13814 | + error::{Error, Result}, |
13815 | + text_processing::wcwidth, |
13816 | + }; |
13817 | + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; |
13818 | + |
13819 | use super::*; |
13820 | use crate::terminal::{cells::*, Color}; |
13821 | - use melib::error::{Error, Result}; |
13822 | - use melib::text_processing::wcwidth; |
13823 | - use nix::sys::wait::WaitStatus; |
13824 | - use nix::sys::wait::{waitpid, WaitPidFlag}; |
13825 | |
13826 | #[derive(Debug)] |
13827 | enum ScreenBuffer { |
13828 | @@ -34,9 +36,9 @@ enum ScreenBuffer { |
13829 | |
13830 | /// `EmbedGrid` manages the terminal grid state of the embed process. |
13831 | /// |
13832 | - /// The embed process sends bytes to the master end (see super mod) and interprets them in a state |
13833 | - /// machine stored in `State`. Escape codes are translated as changes to the grid, eg changes in a |
13834 | - /// cell's colors. |
13835 | + /// The embed process sends bytes to the master end (see super mod) and |
13836 | + /// interprets them in a state machine stored in `State`. Escape codes are |
13837 | + /// translated as changes to the grid, eg changes in a cell's colors. |
13838 | /// |
13839 | /// The main process copies the grid whenever the actual terminal is redrawn. |
13840 | #[derive(Debug)] |
13841 | @@ -52,8 +54,8 @@ pub struct EmbedGrid { |
13842 | fg_color: Color, |
13843 | bg_color: Color, |
13844 | attrs: Attr, |
13845 | - /// Store the fg/bg color when highlighting the cell where the cursor is so that it can be |
13846 | - /// restored afterwards |
13847 | + /// Store the fg/bg color when highlighting the cell where the cursor is so |
13848 | + /// that it can be restored afterwards |
13849 | prev_fg_color: Option<Color>, |
13850 | prev_bg_color: Option<Color>, |
13851 | prev_attrs: Option<Attr>, |
13852 | @@ -405,7 +407,7 @@ impl EmbedGrid { |
13853 | *state = State::CsiQ(buf1); |
13854 | } |
13855 | /* OSC stuff */ |
13856 | - (c, State::Osc1(ref mut buf)) if (b'0'..=b'9').contains(&c) || c == b'?' => { |
13857 | + (c, State::Osc1(ref mut buf)) if c.is_ascii_digit() || c == b'?' => { |
13858 | buf.push(c); |
13859 | } |
13860 | (b';', State::Osc1(ref mut buf1_p)) => { |
13861 | @@ -413,7 +415,7 @@ impl EmbedGrid { |
13862 | let buf2 = SmallVec::new(); |
13863 | *state = State::Osc2(buf1, buf2); |
13864 | } |
13865 | - (c, State::Osc2(_, ref mut buf)) if (b'0'..=b'9').contains(&c) || c == b'?' => { |
13866 | + (c, State::Osc2(_, ref mut buf)) if c.is_ascii_digit() || c == b'?' => { |
13867 | buf.push(c); |
13868 | } |
13869 | /* Normal */ |
13870 | @@ -575,7 +577,7 @@ impl EmbedGrid { |
13871 | *state = State::Normal; |
13872 | } |
13873 | /* CSI ? stuff */ |
13874 | - (c, State::CsiQ(ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
13875 | + (c, State::CsiQ(ref mut buf)) if c.is_ascii_digit() => { |
13876 | buf.push(c); |
13877 | } |
13878 | (b'h', State::CsiQ(ref buf)) => { |
13879 | @@ -652,13 +654,13 @@ impl EmbedGrid { |
13880 | *state = State::Normal; |
13881 | } |
13882 | /* END OF CSI ? stuff */ |
13883 | - (c, State::Csi) if (b'0'..=b'9').contains(&c) => { |
13884 | + (c, State::Csi) if c.is_ascii_digit() => { |
13885 | let mut buf1 = SmallVec::new(); |
13886 | buf1.push(c); |
13887 | *state = State::Csi1(buf1); |
13888 | } |
13889 | (b'J', State::Csi) => { |
13890 | - /* Erase in Display (ED), VT100.*/ |
13891 | + /* Erase in Display (ED), VT100. */ |
13892 | /* Erase Below (default). */ |
13893 | clear_area( |
13894 | grid, |
13895 | @@ -681,7 +683,7 @@ impl EmbedGrid { |
13896 | *state = State::Normal; |
13897 | } |
13898 | (b'K', State::Csi) => { |
13899 | - /* Erase in Line (ED), VT100.*/ |
13900 | + /* Erase in Line (ED), VT100. */ |
13901 | /* Erase to right (Default) */ |
13902 | //debug!("{}", EscCode::from((&(*state), byte))); |
13903 | for x in cursor.0..terminal_size.0 { |
13904 | @@ -732,7 +734,7 @@ impl EmbedGrid { |
13905 | *state = State::Normal; |
13906 | } |
13907 | (b'K', State::Csi1(buf)) if buf.as_ref() == b"0" => { |
13908 | - /* Erase in Line (ED), VT100.*/ |
13909 | + /* Erase in Line (ED), VT100. */ |
13910 | /* Erase to right (Default) */ |
13911 | //debug!("{}", EscCode::from((&(*state), byte))); |
13912 | for x in cursor.0..terminal_size.0 { |
13913 | @@ -741,7 +743,7 @@ impl EmbedGrid { |
13914 | *state = State::Normal; |
13915 | } |
13916 | (b'K', State::Csi1(buf)) if buf.as_ref() == b"1" => { |
13917 | - /* Erase in Line (ED), VT100.*/ |
13918 | + /* Erase in Line (ED), VT100. */ |
13919 | /* Erase to left (Default) */ |
13920 | for x in 0..=cursor.0 { |
13921 | grid[(x, cursor.1)] = Cell::default(); |
13922 | @@ -750,7 +752,7 @@ impl EmbedGrid { |
13923 | *state = State::Normal; |
13924 | } |
13925 | (b'K', State::Csi1(buf)) if buf.as_ref() == b"2" => { |
13926 | - /* Erase in Line (ED), VT100.*/ |
13927 | + /* Erase in Line (ED), VT100. */ |
13928 | /* Erase all */ |
13929 | for y in 0..terminal_size.1 { |
13930 | for x in 0..terminal_size.0 { |
13931 | @@ -766,7 +768,7 @@ impl EmbedGrid { |
13932 | *state = State::Normal; |
13933 | } |
13934 | (b'J', State::Csi1(ref buf)) if buf.as_ref() == b"0" => { |
13935 | - /* Erase in Display (ED), VT100.*/ |
13936 | + /* Erase in Display (ED), VT100. */ |
13937 | /* Erase Below (default). */ |
13938 | clear_area( |
13939 | grid, |
13940 | @@ -789,7 +791,7 @@ impl EmbedGrid { |
13941 | *state = State::Normal; |
13942 | } |
13943 | (b'J', State::Csi1(ref buf)) if buf.as_ref() == b"1" => { |
13944 | - /* Erase in Display (ED), VT100.*/ |
13945 | + /* Erase in Display (ED), VT100. */ |
13946 | /* Erase Above */ |
13947 | clear_area( |
13948 | grid, |
13949 | @@ -806,7 +808,7 @@ impl EmbedGrid { |
13950 | *state = State::Normal; |
13951 | } |
13952 | (b'J', State::Csi1(ref buf)) if buf.as_ref() == b"2" => { |
13953 | - /* Erase in Display (ED), VT100.*/ |
13954 | + /* Erase in Display (ED), VT100. */ |
13955 | /* Erase All */ |
13956 | clear_area( |
13957 | grid, |
13958 | @@ -817,7 +819,7 @@ impl EmbedGrid { |
13959 | *state = State::Normal; |
13960 | } |
13961 | (b'X', State::Csi1(ref buf)) => { |
13962 | - /* Erase Ps Character(s) (default = 1) (ECH)..*/ |
13963 | + /* Erase Ps Character(s) (default = 1) (ECH).. */ |
13964 | let ps = unsafe { std::str::from_utf8_unchecked(buf) } |
13965 | .parse::<usize>() |
13966 | .unwrap(); |
13967 | @@ -842,8 +844,8 @@ impl EmbedGrid { |
13968 | (b't', State::Csi1(buf)) => { |
13969 | /* Window manipulation */ |
13970 | if buf.as_ref() == b"18" || buf.as_ref() == b"19" { |
13971 | - // Ps = 18 → Report the size of the text area in characters as CSI 8 ; height ; width t |
13972 | - //debug!("report size of the text area"); |
13973 | + // Ps = 18 → Report the size of the text area in characters as CSI 8 ; height ; |
13974 | + // width t debug!("report size of the text area"); |
13975 | //debug!("got {}", EscCode::from((&(*state), byte))); |
13976 | stdin.write_all(b"\x1b[8;").unwrap(); |
13977 | stdin |
13978 | @@ -856,7 +858,8 @@ impl EmbedGrid { |
13979 | stdin.write_all(&[b't']).unwrap(); |
13980 | stdin.flush().unwrap(); |
13981 | } else { |
13982 | - //debug!("ignoring unknown code {}", EscCode::from((&(*state), byte))); |
13983 | + //debug!("ignoring unknown code {}", |
13984 | + // EscCode::from((&(*state), byte))); |
13985 | } |
13986 | *state = State::Normal; |
13987 | } |
13988 | @@ -980,7 +983,8 @@ impl EmbedGrid { |
13989 | cursor.0 = new_col.saturating_sub(1); |
13990 | } else { |
13991 | //debug!( |
13992 | - // "error: new_cal = {} > terminal.size.0 = {}\nterminal_size = {:?}", |
13993 | + // "error: new_cal = {} > terminal.size.0 = |
13994 | + // {}\nterminal_size = {:?}", |
13995 | // new_col, terminal_size.0, terminal_size |
13996 | //); |
13997 | } |
13998 | @@ -1269,7 +1273,7 @@ impl EmbedGrid { |
13999 | grid[cursor_val!()].set_attrs(*attrs); |
14000 | *state = State::Normal; |
14001 | } |
14002 | - (c, State::Csi1(ref mut buf)) if (b'0'..=b'9').contains(&c) || c == b' ' => { |
14003 | + (c, State::Csi1(ref mut buf)) if c.is_ascii_digit() || c == b' ' => { |
14004 | buf.push(c); |
14005 | } |
14006 | (b';', State::Csi2(ref mut buf1_p, ref mut buf2_p)) => { |
14007 | @@ -1319,11 +1323,12 @@ impl EmbedGrid { |
14008 | //debug!("cursor became: {:?}", cursor); |
14009 | *state = State::Normal; |
14010 | } |
14011 | - (c, State::Csi2(_, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14012 | + (c, State::Csi2(_, ref mut buf)) if c.is_ascii_digit() => { |
14013 | buf.push(c); |
14014 | } |
14015 | (b'r', State::Csi2(_, _)) | (b'r', State::Csi) => { |
14016 | - /* CSI Ps ; Ps r Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM). */ |
14017 | + /* CSI Ps ; Ps r Set Scrolling Region [top;bottom] (default = full size of |
14018 | + * window) (DECSTBM). */ |
14019 | let (top, bottom) = if let State::Csi2(ref top, ref bottom) = state { |
14020 | ( |
14021 | unsafe { std::str::from_utf8_unchecked(top) } |
14022 | @@ -1352,7 +1357,7 @@ impl EmbedGrid { |
14023 | *state = State::Normal; |
14024 | } |
14025 | |
14026 | - (c, State::Csi3(_, _, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14027 | + (c, State::Csi3(_, _, ref mut buf)) if c.is_ascii_digit() => { |
14028 | buf.push(c); |
14029 | } |
14030 | (b'm', State::Csi3(ref buf1, ref buf2, ref buf3)) |
14031 | @@ -1385,7 +1390,7 @@ impl EmbedGrid { |
14032 | grid[cursor_val!()].set_bg(*bg_color); |
14033 | *state = State::Normal; |
14034 | } |
14035 | - (c, State::Csi3(_, _, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14036 | + (c, State::Csi3(_, _, ref mut buf)) if c.is_ascii_digit() => { |
14037 | buf.push(c); |
14038 | } |
14039 | (b';', State::Csi3(ref mut buf1_p, ref mut buf2_p, ref mut buf3_p)) => { |
14040 | @@ -1395,7 +1400,7 @@ impl EmbedGrid { |
14041 | let buf4 = SmallVec::new(); |
14042 | *state = State::Csi4(buf1, buf2, buf3, buf4); |
14043 | } |
14044 | - (c, State::Csi4(_, _, _, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14045 | + (c, State::Csi4(_, _, _, ref mut buf)) if c.is_ascii_digit() => { |
14046 | buf.push(c); |
14047 | } |
14048 | (b';', State::Csi4(ref mut buf1_p, ref mut buf2_p, ref mut buf3_p, ref mut buf4_p)) => { |
14049 | @@ -1406,7 +1411,7 @@ impl EmbedGrid { |
14050 | let buf5 = SmallVec::new(); |
14051 | *state = State::Csi5(buf1, buf2, buf3, buf4, buf5); |
14052 | } |
14053 | - (c, State::Csi5(_, _, _, _, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14054 | + (c, State::Csi5(_, _, _, _, ref mut buf)) if c.is_ascii_digit() => { |
14055 | buf.push(c); |
14056 | } |
14057 | ( |
14058 | @@ -1427,7 +1432,7 @@ impl EmbedGrid { |
14059 | let buf6 = SmallVec::new(); |
14060 | *state = State::Csi6(buf1, buf2, buf3, buf4, buf5, buf6); |
14061 | } |
14062 | - (c, State::Csi6(_, _, _, _, _, ref mut buf)) if (b'0'..=b'9').contains(&c) => { |
14063 | + (c, State::Csi6(_, _, _, _, _, ref mut buf)) if c.is_ascii_digit() => { |
14064 | buf.push(c); |
14065 | } |
14066 | ( |
14067 | diff --git a/src/terminal/keys.rs b/src/terminal/keys.rs |
14068 | index 10ba784..6d558f8 100644 |
14069 | --- a/src/terminal/keys.rs |
14070 | +++ b/src/terminal/keys.rs |
14071 | @@ -19,11 +19,11 @@ |
14072 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
14073 | */ |
14074 | |
14075 | - use super::*; |
14076 | use crossbeam::{channel::Receiver, select}; |
14077 | use serde::{Serialize, Serializer}; |
14078 | - use termion::event::Event as TermionEvent; |
14079 | - use termion::event::Key as TermionKey; |
14080 | + use termion::event::{Event as TermionEvent, Key as TermionKey}; |
14081 | + |
14082 | + use super::*; |
14083 | |
14084 | #[derive(Debug, PartialEq, Eq, Clone)] |
14085 | pub enum Key { |
14086 | @@ -59,7 +59,8 @@ pub enum Key { |
14087 | Alt(char), |
14088 | /// Ctrl modified character. |
14089 | /// |
14090 | - /// Note that certain keys may not be modifiable with `ctrl`, due to limitations of terminals. |
14091 | + /// Note that certain keys may not be modifiable with `ctrl`, due to |
14092 | + /// limitations of terminals. |
14093 | Ctrl(char), |
14094 | /// Null byte. |
14095 | Null, |
14096 | @@ -69,8 +70,7 @@ pub enum Key { |
14097 | Paste(String), |
14098 | } |
14099 | |
14100 | - pub use termion::event::MouseButton; |
14101 | - pub use termion::event::MouseEvent; |
14102 | + pub use termion::event::{MouseButton, MouseEvent}; |
14103 | |
14104 | impl fmt::Display for Key { |
14105 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
14106 | @@ -153,18 +153,21 @@ pub enum InputCommand { |
14107 | Kill, |
14108 | } |
14109 | |
14110 | - use nix::poll::{poll, PollFd, PollFlags}; |
14111 | use std::os::unix::io::{AsRawFd, RawFd}; |
14112 | + |
14113 | + use nix::poll::{poll, PollFd, PollFlags}; |
14114 | use termion::input::TermReadEventsAndRaw; |
14115 | /* |
14116 | - * If we fork (for example start $EDITOR) we want the input-thread to stop reading from stdin. The |
14117 | - * best way I came up with right now is to send a signal to the thread that is read in the first |
14118 | - * input in stdin after the fork, and then the thread kills itself. The parent process spawns a new |
14119 | + * If we fork (for example start $EDITOR) we want the input-thread to stop |
14120 | + * reading from stdin. The best way I came up with right now is to send a |
14121 | + * signal to the thread that is read in the first input in stdin after the |
14122 | + * fork, and then the thread kills itself. The parent process spawns a new |
14123 | * input-thread when the child returns. |
14124 | * |
14125 | * The main loop uses try_wait_on_child() to check if child has exited. |
14126 | */ |
14127 | - /// The thread function that listens for user input and forwards it to the main event loop. |
14128 | + /// The thread function that listens for user input and forwards it to the main |
14129 | + /// event loop. |
14130 | pub fn get_events( |
14131 | mut closure: impl FnMut((Key, Vec<u8>)), |
14132 | rx: &Receiver<InputCommand>, |
14133 | @@ -287,8 +290,8 @@ impl<'de> Deserialize<'de> for Key { |
14134 | } |
14135 | } |
14136 | Err(de::Error::custom(format!( |
14137 | - "`{}` should be a number 1 <= n <= 12 instead.", |
14138 | - &s[1..] |
14139 | + "`{}` should be a number 1 <= n <= 12 instead.", |
14140 | + &s[1..] |
14141 | ))) |
14142 | } |
14143 | s if s.starts_with("M-") && s.len() == 3 => { |
14144 | @@ -299,8 +302,8 @@ impl<'de> Deserialize<'de> for Key { |
14145 | } |
14146 | |
14147 | Err(de::Error::custom(format!( |
14148 | - "`{}` should be a lowercase and alphanumeric character instead.", |
14149 | - &s[2..] |
14150 | + "`{}` should be a lowercase and alphanumeric character instead.", |
14151 | + &s[2..] |
14152 | ))) |
14153 | } |
14154 | s if s.starts_with("C-") && s.len() == 3 => { |
14155 | @@ -310,13 +313,14 @@ impl<'de> Deserialize<'de> for Key { |
14156 | return Ok(Key::Ctrl(c)); |
14157 | } |
14158 | Err(de::Error::custom(format!( |
14159 | - "`{}` should be a lowercase and alphanumeric character instead.", |
14160 | - &s[2..] |
14161 | + "`{}` should be a lowercase and alphanumeric character instead.", |
14162 | + &s[2..] |
14163 | ))) |
14164 | } |
14165 | _ => Err(de::Error::custom(format!( |
14166 | - "Cannot derive shortcut from `{}`. Please consult the manual for valid key inputs.", |
14167 | - value |
14168 | + "Cannot derive shortcut from `{}`. Please consult the manual for valid \ |
14169 | + key inputs.", |
14170 | + value |
14171 | ))), |
14172 | } |
14173 | } |
14174 | diff --git a/src/terminal/position.rs b/src/terminal/position.rs |
14175 | index 8f62da8..6391012 100644 |
14176 | --- a/src/terminal/position.rs |
14177 | +++ b/src/terminal/position.rs |
14178 | @@ -142,7 +142,6 @@ macro_rules! bottom_right { |
14179 | /// let invalid_area = ((2, 2), (1, 1)); |
14180 | /// assert!(!is_valid_area!(invalid_area)); |
14181 | /// ``` |
14182 | - /// |
14183 | #[macro_export] |
14184 | macro_rules! is_valid_area { |
14185 | ($a:expr) => {{ |
14186 | @@ -172,25 +171,22 @@ pub fn center_area(area: Area, (width, height): (usize, usize)) -> Area { |
14187 | ) |
14188 | } |
14189 | |
14190 | - #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
14191 | + #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] |
14192 | pub enum Alignment { |
14193 | - /// Stretch to fill all space if possible, center if no meaningful way to stretch. |
14194 | + /// Stretch to fill all space if possible, center if no meaningful way to |
14195 | + /// stretch. |
14196 | Fill, |
14197 | /// Snap to left or top side, leaving space on right or bottom. |
14198 | Start, |
14199 | /// Snap to right or bottom side, leaving space on left or top. |
14200 | End, |
14201 | /// Center natural width of widget inside the allocation. |
14202 | + #[default] |
14203 | Center, |
14204 | } |
14205 | |
14206 | - impl Default for Alignment { |
14207 | - fn default() -> Self { |
14208 | - Alignment::Center |
14209 | - } |
14210 | - } |
14211 | - |
14212 | - /// Place given area of dimensions `(width, height)` inside `area` according to given alignment |
14213 | + /// Place given area of dimensions `(width, height)` inside `area` according to |
14214 | + /// given alignment |
14215 | pub fn align_area( |
14216 | area: Area, |
14217 | (width, height): (usize, usize), |
14218 | diff --git a/src/types.rs b/src/types.rs |
14219 | index b338e87..fdb2f96 100644 |
14220 | --- a/src/types.rs |
14221 | +++ b/src/types.rs |
14222 | @@ -21,32 +21,36 @@ |
14223 | |
14224 | /*! UI types used throughout meli. |
14225 | * |
14226 | - * The `segment_tree` module performs maximum range queries. This is used in getting the maximum |
14227 | - * element of a column within a specific range in e-mail lists. That way a very large value that |
14228 | - * is not the in the currently displayed page does not cause the column to be rendered bigger |
14229 | + * The `segment_tree` module performs maximum range queries. This is used in |
14230 | + * getting the maximum element of a column within a specific range in e-mail |
14231 | + * lists. That way a very large value that is not the in the currently |
14232 | + * displayed page does not cause the column to be rendered bigger |
14233 | * than it has to. |
14234 | * |
14235 | - * `UIMode` describes the application's... mode. Same as in the modal editor `vi`. |
14236 | + * `UIMode` describes the application's... mode. Same as in the modal editor |
14237 | + * `vi`. |
14238 | * |
14239 | * `UIEvent` is the type passed around `Component`s when something happens. |
14240 | */ |
14241 | extern crate serde; |
14242 | #[macro_use] |
14243 | mod helpers; |
14244 | - pub use self::helpers::*; |
14245 | - |
14246 | - use super::command::Action; |
14247 | - use super::jobs::{JobExecutor, JobId}; |
14248 | - use super::terminal::*; |
14249 | - use crate::components::{Component, ComponentId, ScrollUpdate}; |
14250 | - use std::borrow::Cow; |
14251 | - use std::sync::Arc; |
14252 | + use std::{borrow::Cow, fmt, sync::Arc}; |
14253 | |
14254 | - use melib::backends::{AccountHash, BackendEvent, MailboxHash}; |
14255 | - use melib::uuid::Uuid; |
14256 | - use melib::{EnvelopeHash, RefreshEvent, ThreadHash}; |
14257 | + use melib::{ |
14258 | + backends::{AccountHash, BackendEvent, MailboxHash}, |
14259 | + uuid::Uuid, |
14260 | + EnvelopeHash, RefreshEvent, ThreadHash, |
14261 | + }; |
14262 | use nix::unistd::Pid; |
14263 | - use std::fmt; |
14264 | + |
14265 | + pub use self::helpers::*; |
14266 | + use super::{ |
14267 | + command::Action, |
14268 | + jobs::{JobExecutor, JobId}, |
14269 | + terminal::*, |
14270 | + }; |
14271 | + use crate::components::{Component, ComponentId, ScrollUpdate}; |
14272 | |
14273 | #[derive(Debug)] |
14274 | pub enum StatusEvent { |
14275 | @@ -62,8 +66,8 @@ pub enum StatusEvent { |
14276 | ScrollUpdate(ScrollUpdate), |
14277 | } |
14278 | |
14279 | - /// `ThreadEvent` encapsulates all of the possible values we need to transfer between our threads |
14280 | - /// to the main process. |
14281 | + /// `ThreadEvent` encapsulates all of the possible values we need to transfer |
14282 | + /// between our threads to the main process. |
14283 | #[derive(Debug)] |
14284 | pub enum ThreadEvent { |
14285 | /// User input. |
14286 | @@ -196,12 +200,13 @@ impl fmt::Display for UIMode { |
14287 | } |
14288 | |
14289 | pub mod segment_tree { |
14290 | - /*! Simple segment tree implementation for maximum in range queries. This is useful if given an |
14291 | - * array of numbers you want to get the maximum value inside an interval quickly. |
14292 | + /*! Simple segment tree implementation for maximum in range queries. This |
14293 | + * is useful if given an array of numbers you want to get the |
14294 | + * maximum value inside an interval quickly. |
14295 | */ |
14296 | + use std::{convert::TryFrom, iter::FromIterator}; |
14297 | + |
14298 | use smallvec::SmallVec; |
14299 | - use std::convert::TryFrom; |
14300 | - use std::iter::FromIterator; |
14301 | |
14302 | #[derive(Default, Debug, Clone)] |
14303 | pub struct SegmentTree { |
14304 | @@ -299,7 +304,7 @@ pub mod segment_tree { |
14305 | .iter() |
14306 | .cloned() |
14307 | .collect::<SmallVec<[u8; 1024]>>(); |
14308 | - let mut segment_tree = SegmentTree::from(array.clone()); |
14309 | + let mut segment_tree = SegmentTree::from(array); |
14310 | |
14311 | assert_eq!(segment_tree.get_max(0, 5), 23); |
14312 | assert_eq!(segment_tree.get_max(6, 9), 37); |
14313 | diff --git a/src/types/helpers.rs b/src/types/helpers.rs |
14314 | index 1f33f67..1d411df 100644 |
14315 | --- a/src/types/helpers.rs |
14316 | +++ b/src/types/helpers.rs |
14317 | @@ -19,11 +19,13 @@ |
14318 | * along with meli. If not, see <http://www.gnu.org/licenses/>. |
14319 | */ |
14320 | |
14321 | - use std::fs; |
14322 | - use std::fs::OpenOptions; |
14323 | - use std::io::{Read, Write}; |
14324 | - use std::os::unix::fs::PermissionsExt; |
14325 | - use std::path::PathBuf; |
14326 | + use std::{ |
14327 | + fs, |
14328 | + fs::OpenOptions, |
14329 | + io::{Read, Write}, |
14330 | + os::unix::fs::PermissionsExt, |
14331 | + path::PathBuf, |
14332 | + }; |
14333 | |
14334 | use melib::uuid::Uuid; |
14335 | |
14336 | @@ -65,8 +67,8 @@ impl File { |
14337 | } |
14338 | } |
14339 | |
14340 | - /// Returned `File` will be deleted when dropped if delete_on_drop is set, so make sure to add it on `context.temp_files` |
14341 | - /// to reap it later. |
14342 | + /// Returned `File` will be deleted when dropped if delete_on_drop is set, so |
14343 | + /// make sure to add it on `context.temp_files` to reap it later. |
14344 | pub fn create_temp_file( |
14345 | bytes: &[u8], |
14346 | filename: Option<&str>, |
14347 | diff --git a/tools/src/email_parse.rs b/tools/src/email_parse.rs |
14348 | index aa240a0..c2312ac 100644 |
14349 | --- a/tools/src/email_parse.rs |
14350 | +++ b/tools/src/email_parse.rs |
14351 | @@ -1,8 +1,8 @@ |
14352 | extern crate melib; |
14353 | - use melib::Result; |
14354 | - use melib::*; |
14355 | + use melib::{Result, *}; |
14356 | |
14357 | - /// Parses e-mail from files and prints the debug information of the parsed `Envelope` |
14358 | + /// Parses e-mail from files and prints the debug information of the parsed |
14359 | + /// `Envelope` |
14360 | /// |
14361 | /// # Example invocation |
14362 | /// ```sh |
14363 | @@ -21,8 +21,8 @@ fn main() -> Result<()> { |
14364 | |
14365 | if filename.exists() && filename.is_file() { |
14366 | let buffer = std::fs::read_to_string(&filename) |
14367 | - .expect(&format!("Something went wrong reading the file {}", i,)); |
14368 | - let env = Envelope::from_bytes(&buffer.as_bytes(), None).expect("Couldn't parse email"); |
14369 | + .unwrap_or_else(|_| panic!("Something went wrong reading the file {}", i)); |
14370 | + let env = Envelope::from_bytes(buffer.as_bytes(), None).expect("Couldn't parse email"); |
14371 | println!("Env is {:#?}", env); |
14372 | println!("{:?}", env.body_bytes(buffer.as_bytes())); |
14373 | } else { |
14374 | diff --git a/tools/src/embed.rs b/tools/src/embed.rs |
14375 | index b2a2299..c6847a2 100644 |
14376 | --- a/tools/src/embed.rs |
14377 | +++ b/tools/src/embed.rs |
14378 | @@ -1,11 +1,15 @@ |
14379 | - use meli::terminal::embed::*; |
14380 | - use meli::terminal::*; |
14381 | - use meli::*; |
14382 | + use std::{ |
14383 | + fs::File, |
14384 | + io::prelude::*, |
14385 | + os::raw::c_int, |
14386 | + sync::{Arc, Mutex}, |
14387 | + }; |
14388 | + |
14389 | + use meli::{ |
14390 | + terminal::{embed::*, *}, |
14391 | + *, |
14392 | + }; |
14393 | use nix::sys::wait::WaitStatus; |
14394 | - use std::fs::File; |
14395 | - use std::io::prelude::*; |
14396 | - use std::os::raw::c_int; |
14397 | - use std::sync::{Arc, Mutex}; |
14398 | |
14399 | fn notify( |
14400 | signals: &[c_int], |
14401 | @@ -140,7 +144,7 @@ impl Component for EmbedContainer { |
14402 | change_colors(grid, embed_area, Color::Byte(8), theme_default.bg); |
14403 | let stopped_message: String = |
14404 | format!("Process with PID {} has stopped.", guard.child_pid); |
14405 | - let stopped_message_2: String = format!("-press 'e' to re-activate.",); |
14406 | + let stopped_message_2: String = "-press 'e' to re-activate.".to_string(); |
14407 | const STOPPED_MESSAGE_3: &str = |
14408 | "-press Ctrl-C to forcefully kill it and return to editor."; |
14409 | let max_len = std::cmp::max( |
14410 | @@ -215,7 +219,6 @@ impl Component for EmbedContainer { |
14411 | } |
14412 | context.dirty_areas.push_back(area); |
14413 | self.dirty = false; |
14414 | - return; |
14415 | } |
14416 | |
14417 | fn process_event(&mut self, event: &mut UIEvent, context: &mut Context) -> bool { |
14418 | @@ -244,7 +247,7 @@ impl Component for EmbedContainer { |
14419 | match embed_guard.is_active() { |
14420 | Ok(WaitStatus::Exited(_, exit_code)) => { |
14421 | drop(embed_guard); |
14422 | - let embed = self.embed.take(); |
14423 | + _ = self.embed.take(); |
14424 | if exit_code != 0 { |
14425 | context.replies.push_back(UIEvent::Notification( |
14426 | None, |
14427 | @@ -393,11 +396,11 @@ impl Component for EmbedContainer { |
14428 | |
14429 | fn main() -> std::io::Result<()> { |
14430 | let command = std::env::args() |
14431 | - .skip(1) |
14432 | - .next() |
14433 | + .nth(1) |
14434 | .expect("expected command as first argument"); |
14435 | - /* Create a channel to communicate with other threads. The main process is the sole receiver. |
14436 | - * */ |
14437 | + /* Create a channel to communicate with other threads. The main process is |
14438 | + * the sole receiver. |
14439 | + */ |
14440 | let (sender, receiver) = crossbeam::channel::bounded(32 * ::std::mem::size_of::<ThreadEvent>()); |
14441 | /* Catch SIGWINCH to handle terminal resizing */ |
14442 | let signals = &[ |
14443 | @@ -425,7 +428,8 @@ fn main() -> std::io::Result<()> { |
14444 | } |
14445 | state.redraw(); |
14446 | |
14447 | - /* Poll on all channels. Currently we have the input channel for stdin, watching events and the signal watcher. */ |
14448 | + /* Poll on all channels. Currently we have the input channel for stdin, |
14449 | + * watching events and the signal watcher. */ |
14450 | crossbeam::select! { |
14451 | recv(receiver) -> r => { |
14452 | match r { |
14453 | diff --git a/tools/src/imapshell.rs b/tools/src/imapshell.rs |
14454 | index e6df86b..3b50eb5 100644 |
14455 | --- a/tools/src/imapshell.rs |
14456 | +++ b/tools/src/imapshell.rs |
14457 | @@ -1,17 +1,17 @@ |
14458 | extern crate melib; |
14459 | |
14460 | - use melib::backends::ImapType; |
14461 | - use melib::{futures, smol, Result}; |
14462 | - use melib::{AccountSettings, BackendEventConsumer}; |
14463 | + use melib::{backends::ImapType, futures, smol, AccountSettings, BackendEventConsumer, Result}; |
14464 | |
14465 | - /// Opens an interactive shell on an IMAP server. Suggested use is with rlwrap(1) |
14466 | + /// Opens an interactive shell on an IMAP server. Suggested use is with |
14467 | + /// rlwrap(1) |
14468 | /// |
14469 | /// # Example invocation: |
14470 | /// ```sh |
14471 | /// ./imapshell server_hostname server_username server_password server_port"); |
14472 | /// ``` |
14473 | /// |
14474 | - /// `danger_accept_invalid_certs` is turned on by default, so no certificate validation is performed. |
14475 | + /// `danger_accept_invalid_certs` is turned on by default, so no certificate |
14476 | + /// validation is performed. |
14477 | |
14478 | fn main() -> Result<()> { |
14479 | let mut args = std::env::args().skip(1).collect::<Vec<String>>(); |
14480 | @@ -21,10 +21,10 @@ fn main() -> Result<()> { |
14481 | } |
14482 | |
14483 | let (a, b, c, d) = ( |
14484 | - std::mem::replace(&mut args[0], String::new()), |
14485 | - std::mem::replace(&mut args[1], String::new()), |
14486 | - std::mem::replace(&mut args[2], String::new()), |
14487 | - std::mem::replace(&mut args[3], String::new()), |
14488 | + std::mem::take(&mut args[0]), |
14489 | + std::mem::take(&mut args[1]), |
14490 | + std::mem::take(&mut args[2]), |
14491 | + std::mem::take(&mut args[3]), |
14492 | ); |
14493 | let set = AccountSettings { |
14494 | extra: [ |
14495 | diff --git a/tools/src/mboxparse.rs b/tools/src/mboxparse.rs |
14496 | index 100018f..ac28bdc 100644 |
14497 | --- a/tools/src/mboxparse.rs |
14498 | +++ b/tools/src/mboxparse.rs |
14499 | @@ -22,7 +22,8 @@ |
14500 | extern crate melib; |
14501 | use melib::Result; |
14502 | |
14503 | - /// Parses e-mail from files and prints the debug information of the parsed `Envelope` |
14504 | + /// Parses e-mail from files and prints the debug information of the parsed |
14505 | + /// `Envelope` |
14506 | /// |
14507 | /// # Example invocation |
14508 | /// ```sh |
14509 | @@ -41,7 +42,7 @@ fn main() -> Result<()> { |
14510 | |
14511 | if filename.exists() && filename.is_file() { |
14512 | let buffer = std::fs::read_to_string(&filename) |
14513 | - .expect(&format!("Something went wrong reading the file {}", i,)); |
14514 | + .unwrap_or_else(|_| panic!("Something went wrong reading the file {}", i)); |
14515 | let res = |
14516 | melib::backends::mbox::mbox_parse(Default::default(), buffer.as_bytes(), 0, None); |
14517 | match res { |
14518 | diff --git a/tools/src/smtp_conn.rs b/tools/src/smtp_conn.rs |
14519 | index 913cc86..00ea8c9 100644 |
14520 | --- a/tools/src/smtp_conn.rs |
14521 | +++ b/tools/src/smtp_conn.rs |
14522 | @@ -1,9 +1,6 @@ |
14523 | extern crate melib; |
14524 | |
14525 | - use melib::futures; |
14526 | - use melib::smol; |
14527 | - use melib::smtp::*; |
14528 | - use melib::Result; |
14529 | + use melib::{futures, smol, smtp::*, Result}; |
14530 | |
14531 | fn main() -> Result<()> { |
14532 | let conf = SmtpServerConf { |