File: types.rs

package info (click to toggle)
rust-linkify 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 220 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use linkify::Link;
use linkify::LinkFinder;
use linkify::LinkKind;

#[test]
fn send_and_sync() {
    check_send::<LinkFinder>();
    check_sync::<LinkFinder>();

    check_send::<Link<'_>>();
    check_sync::<Link<'_>>();
}

#[test]
fn equality() {
    let finder = LinkFinder::new();
    let first = finder.links("http://example.org").next();
    assert!(first.is_some());

    let link = first.unwrap();
    // Check that link has Debug
    println!("{:?}", link);

    assert_eq!(link.kind(), &LinkKind::Url);
}

fn check_send<T: Send>() {}

fn check_sync<T: Sync>() {}