mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-30 21:32:02 +00:00
Use a generic ToString object in new.
This commit is contained in:
parent
32bf3e1737
commit
f259593727
@ -12,7 +12,7 @@ use hyper::server::Server as HyperServer;
|
||||
use hyper::server::Handler as HyperHandler;
|
||||
|
||||
pub struct Rocket {
|
||||
address: &'static str,
|
||||
address: String,
|
||||
port: isize,
|
||||
router: Router,
|
||||
catchers: HashMap<u16, Catcher>,
|
||||
@ -81,9 +81,9 @@ impl Rocket {
|
||||
catcher.handle(Error::NoRoute, request).respond(response);
|
||||
}
|
||||
|
||||
pub fn new(address: &'static str, port: isize) -> Rocket {
|
||||
pub fn new<S: ToString>(address: S, port: isize) -> Rocket {
|
||||
Rocket {
|
||||
address: address,
|
||||
address: address.to_string(),
|
||||
port: port,
|
||||
router: Router::new(),
|
||||
catchers: catcher::defaults::get(),
|
||||
|
Loading…
Reference in New Issue
Block a user