1
0
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:
Rob Ede
2023-07-09 03:32:47 +01:00
parent 9a5cd90634
commit 8fd4262136
14 changed files with 26 additions and 29 deletions

View File

@ -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())

View File

@ -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

View File

@ -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");