feat: type adjustmets

This commit is contained in:
Aravinth Manivannan 2022-05-17 01:03:27 +05:30
parent a146386e68
commit ec9bb69f98
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 3 additions and 7 deletions

View file

@ -93,7 +93,7 @@ pub struct AddRepository<'a> {
/// html link to the repository
pub html_link: &'a str,
/// repository topic tags
pub tags: Option<Vec<String>>,
pub tags: Option<Vec<&'a str>>,
/// hostname of the forge instance: with scheme but remove trailing slash
/// hostname can be derived from html_link also, but used to link to user's forge instance
pub hostname: &'a str,

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use db_core::dev::*;
use std::str::FromStr;
use sqlx::sqlite::SqlitePool;
use sqlx::sqlite::SqlitePoolOptions;
@ -159,7 +158,7 @@ impl SCDatabase for Database {
{
Ok(_) => Ok(true),
Err(Error::RowNotFound) => Ok(false),
Err(e) => Err(DBError::DBError(Box::new(e)).into()),
Err(e) => Err(DBError::DBError(Box::new(e))),
}
}

View file

@ -15,7 +15,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use std::env;
use std::rc::Rc;
use sqlx::sqlite::SqlitePoolOptions;
use url::Url;
@ -63,12 +62,10 @@ async fn everything_works() {
let connection_options = ConnectionOptions::Fresh(Fresh { pool_options, url });
let db = connection_options.connect().await.unwrap();
let tags = TAGS.iter().map(|s| s.to_string()).collect();
let add_repo_msg = AddRepository {
html_link: HTML_REPO_URL,
name: REPO_NAME,
tags: Some(tags),
tags: Some(TAGS.into()),
owner: USERNAME,
website: None,
description: None,