Get problem from name
(&self, problem_name: &String)
| 117 | |
| 118 | /// Get problem from name |
| 119 | pub fn get_problem_id_from_name(&self, problem_name: &String) -> Result<i32, Error> { |
| 120 | let p: Problem = problems |
| 121 | .filter(name.eq(problem_name)) |
| 122 | .first(&mut self.conn()?)?; |
| 123 | if p.category != "algorithms" { |
| 124 | return Err(anyhow!("No support for database and shell questions yet").into()); |
| 125 | } |
| 126 | Ok(p.fid) |
| 127 | } |
| 128 | |
| 129 | /// Get daily problem |
| 130 | pub async fn get_daily_problem_id(&self) -> Result<i32, Error> { |