aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-07 19:13:55 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-07 19:13:55 +0200
commit0f14dee499f48b11fc329164c30cd475400a9f4d (patch)
treeb78e7546974c2785df5b713cf217ae89ce133475 /planetwars-server/src/routes
parent6ec792e3bd633a0b3971e401d29b2f8671f38b14 (diff)
downloadplanetwars.dev-0f14dee499f48b11fc329164c30cd475400a9f4d.tar.xz
planetwars.dev-0f14dee499f48b11fc329164c30cd475400a9f4d.zip
refactor: rename save_code_bundle to save_code_string
Diffstat (limited to 'planetwars-server/src/routes')
-rw-r--r--planetwars-server/src/routes/bots.rs4
-rw-r--r--planetwars-server/src/routes/demo.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/planetwars-server/src/routes/bots.rs b/planetwars-server/src/routes/bots.rs
index 54c0d36..edb68ae 100644
--- a/planetwars-server/src/routes/bots.rs
+++ b/planetwars-server/src/routes/bots.rs
@@ -14,7 +14,7 @@ use thiserror;
use crate::db::bots::{self, BotVersion};
use crate::db::ratings::{self, RankedBot};
use crate::db::users::User;
-use crate::modules::bots::save_code_bundle;
+use crate::modules::bots::save_code_string;
use crate::{DatabaseConnection, BOTS_DIR};
use bots::Bot;
@@ -120,7 +120,7 @@ pub async fn save_bot(
}
};
let _code_bundle =
- save_code_bundle(&params.code, Some(bot.id), &conn).expect("failed to save code bundle");
+ save_code_string(&params.code, Some(bot.id), &conn).expect("failed to save code bundle");
Ok(Json(bot))
}
diff --git a/planetwars-server/src/routes/demo.rs b/planetwars-server/src/routes/demo.rs
index 1747bfe..4f83de0 100644
--- a/planetwars-server/src/routes/demo.rs
+++ b/planetwars-server/src/routes/demo.rs
@@ -1,6 +1,6 @@
use crate::db;
use crate::db::matches::{FullMatchData, FullMatchPlayerData};
-use crate::modules::bots::save_code_bundle;
+use crate::modules::bots::save_code_string;
use crate::modules::matches::{MatchPlayer, RunMatch};
use crate::ConnectionPool;
use axum::extract::Extension;
@@ -42,7 +42,7 @@ pub async fn submit_bot(
let opponent_bot_version =
db::bots::active_bot_version(opponent.id, &conn).map_err(|_| StatusCode::BAD_REQUEST)?;
- let player_bot_version = save_code_bundle(&params.code, None, &conn)
+ let player_bot_version = save_code_string(&params.code, None, &conn)
// TODO: can we recover from this?
.expect("could not save bot code");