Skip to content

Commit

Permalink
docs(listener): add more documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lomirus committed Dec 23, 2023
1 parent 6dfba3d commit 1fddc98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct Listener {
}

impl Listener {
/// Start live-server
/// Start live-server.
///
/// ```
/// use live_server::listen;
Expand Down Expand Up @@ -76,6 +76,9 @@ impl Listener {
/// assert_eq!(link, "http://127.0.0.1:8080");
/// }
/// ```
///
/// This is useful when you did not specify the host or port (e.g. `listen("0.0.0.0:0", ".")`),
/// because this method will return the specific address.
pub fn link(&self) -> Result<String, Box<dyn Error>> {
let addr = self.tcp_listener.local_addr()?;
let port = addr.port();
Expand Down

0 comments on commit 1fddc98

Please sign in to comment.