Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 06df7ea

Browse files
Only return question ID when searching by name
1 parent 609931c commit 06df7ea

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
@@ -123,7 +123,7 @@ impl Cache {
123123
}
124124

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

138138
/// Get daily problem

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /