mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
use &str
This commit is contained in:
parent
d1e928d163
commit
6f91efbc9c
@ -50,7 +50,7 @@ impl Bookmark {
|
||||
None => {
|
||||
self.memory.add(
|
||||
request.into(),
|
||||
self.database.add(DateTime::now_local()?, request.into())?,
|
||||
self.database.add(DateTime::now_local()?, request)?,
|
||||
)?;
|
||||
true
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ impl Database {
|
||||
|
||||
/// Create new bookmark record in database
|
||||
/// * return last insert ID on success
|
||||
pub fn add(&self, time: DateTime, request: String) -> Result<i64> {
|
||||
pub fn add(&self, time: DateTime, request: &str) -> Result<i64> {
|
||||
let mut writable = self.connection.write().unwrap(); // @TODO
|
||||
let tx = writable.transaction()?;
|
||||
let id = insert(&tx, *self.profile_id, time, request)?;
|
||||
@ -74,7 +74,7 @@ pub fn init(tx: &Transaction) -> Result<usize> {
|
||||
)?)
|
||||
}
|
||||
|
||||
pub fn insert(tx: &Transaction, profile_id: i64, time: DateTime, request: String) -> Result<i64> {
|
||||
pub fn insert(tx: &Transaction, profile_id: i64, time: DateTime, request: &str) -> Result<i64> {
|
||||
tx.execute(
|
||||
"INSERT INTO `profile_bookmark` (
|
||||
`profile_id`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user