mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
s/str::to_string/str::to_owned
This commit is contained in:
@ -124,7 +124,7 @@ mod test {
|
||||
RedisActorSessionStore::new("127.0.0.1:6379"),
|
||||
private_key.clone(),
|
||||
)
|
||||
.cookie_name("test-session".to_string())
|
||||
.cookie_name("test-session".to_owned())
|
||||
.build(),
|
||||
)
|
||||
.wrap(middleware::Logger::default())
|
||||
|
@ -45,7 +45,7 @@ impl From<DBError> for ServiceError {
|
||||
match error {
|
||||
DBError::DatabaseError(kind, info) => {
|
||||
if let DatabaseErrorKind::UniqueViolation = kind {
|
||||
let message = info.details().unwrap_or_else(|| info.message()).to_string();
|
||||
let message = info.details().unwrap_or_else(|| info.message()).to_owned();
|
||||
return ServiceError::BadRequest(message);
|
||||
}
|
||||
ServiceError::InternalServerError
|
||||
|
@ -28,7 +28,7 @@ async fn main() -> std::io::Result<()> {
|
||||
let pool: models::Pool = r2d2::Pool::builder()
|
||||
.build(manager)
|
||||
.expect("Failed to create pool.");
|
||||
let domain: String = std::env::var("DOMAIN").unwrap_or_else(|_| "localhost".to_string());
|
||||
let domain: String = std::env::var("DOMAIN").unwrap_or_else(|_| "localhost".to_owned());
|
||||
|
||||
log::info!("starting HTTP server at http://localhost:8080");
|
||||
|
||||
|
Reference in New Issue
Block a user