Skip to content

Commit 45079f2

Browse files
committed
Only return question ID when searching by name
1 parent 4e9dfa8 commit 45079f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cache/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl Cache {
120120
}
121121

122122
/// Get problem from name
123-
pub fn get_problem_from_name(&self, problem_name: &String) -> Result<Problem, Error> {
123+
pub fn get_problem_id_from_name(&self, problem_name: &String) -> Result<i32, Error> {
124124
let p: Problem = problems
125125
.filter(name.eq(problem_name))
126126
.first(&self.conn()?)?;
@@ -129,7 +129,7 @@ impl Cache {
129129
"Not support database and shell questions for now".to_string(),
130130
));
131131
}
132-
Ok(p)
132+
Ok(p.fid)
133133
}
134134

135135
/// Get daily problem

0 commit comments

Comments
 (0)