Even more documentation bug fixes
Okay. Now everything should work. I realized that cargo doc doesn't test that documentation code works, but that cargo test does.
This commit is contained in:
parent
d08713b412
commit
67767230ab
20
src/lib.rs
20
src/lib.rs
|
@ -26,7 +26,7 @@ const MANIFEST_TOPIC_RE_STR: &str = r"mt=((\w+)://[A-Za-z0-9!@#$%^:*<>,?/()_+=.{
|
|||
///
|
||||
/// ```
|
||||
/// use magnet_url::Magnet;
|
||||
/// let magnet-url = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// let magneturl = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// ```
|
||||
///
|
||||
/// This returns the Magnet struct, which is made up of the fields listed below this section. To
|
||||
|
@ -34,18 +34,18 @@ const MANIFEST_TOPIC_RE_STR: &str = r"mt=((\w+)://[A-Za-z0-9!@#$%^:*<>,?/()_+=.{
|
|||
///
|
||||
/// ```
|
||||
/// use magnet_url::Magnet;
|
||||
/// let magnet-url = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// println!("{:?}", magnet-url.dn);
|
||||
/// let magneturl = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// println!("{:?}", magneturl.dn);
|
||||
/// ```
|
||||
///
|
||||
/// If you'd like to modify parts of the magnet_url to customize it, that can be done as well!
|
||||
///
|
||||
/// ```
|
||||
/// use magnet_url::Magnet;
|
||||
/// let mut magnet-url = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// println!("{:?}", magnet-url.dn);
|
||||
/// magnet_url.dn = String::from("hello_world");
|
||||
/// println!("{:?}", magnet-url.dn);
|
||||
/// let mut magneturl = Magnet::new("magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent");
|
||||
/// println!("{:?}", magneturl.dn);
|
||||
/// magneturl.dn = String::from("hello_world");
|
||||
/// println!("{:?}", magneturl.dn);
|
||||
/// ```
|
||||
///
|
||||
/// In fact, you can construct your own magnet url as well, as long as you fill in all the
|
||||
|
@ -53,7 +53,7 @@ const MANIFEST_TOPIC_RE_STR: &str = r"mt=((\w+)://[A-Za-z0-9!@#$%^:*<>,?/()_+=.{
|
|||
///
|
||||
/// ```
|
||||
/// use magnet_url::Magnet;
|
||||
/// let magnet-url =
|
||||
/// let magneturl =
|
||||
/// //Note, this magnet won't actually download, sorry :/
|
||||
/// Magnet {
|
||||
/// dn: "hello_world".to_string(),
|
||||
|
@ -63,14 +63,14 @@ const MANIFEST_TOPIC_RE_STR: &str = r"mt=((\w+)://[A-Za-z0-9!@#$%^:*<>,?/()_+=.{
|
|||
/// tr:
|
||||
/// {
|
||||
/// let mut tr_vec = Vec::new();
|
||||
/// tr_vec.push("https://example.com/".to_string())
|
||||
/// tr_vec.push("https://example.com/".to_string());
|
||||
/// tr_vec
|
||||
/// },
|
||||
/// kt: "cool+stuff".to_string(),
|
||||
/// ws: String::new(),
|
||||
/// acceptable_source: String::new(),
|
||||
/// mt: String::new(),
|
||||
///
|
||||
/// xs: String::new(),
|
||||
/// };
|
||||
/// ```
|
||||
pub struct Magnet {
|
||||
|
|
Loading…
Reference in New Issue