Simplify symbols bounds a bit
This commit is contained in:
parent
445b3edd9d
commit
e3b425eb1c
7 changed files with 18 additions and 10 deletions
|
|
@ -11,7 +11,7 @@ pub struct Database<'a, D, S, C> {
|
|||
command_runner: &'a C,
|
||||
}
|
||||
|
||||
impl<'a, D, S, C: CommandRunner> Database<'a, D, S, C> {
|
||||
impl<'a, D, S, C> Database<'a, D, S, C> {
|
||||
pub const fn new(db_name: D, seed_file: S, command_runner: &'a C) -> Self {
|
||||
Self {
|
||||
db_name,
|
||||
|
|
@ -19,7 +19,9 @@ impl<'a, D, S, C: CommandRunner> Database<'a, D, S, C> {
|
|||
command_runner,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, D, S, C: CommandRunner> Database<'a, D, S, C> {
|
||||
async fn run_sql(&self, sql: &str) -> Result<String, Box<dyn Error>> {
|
||||
let b = self
|
||||
.command_runner
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub struct Dump<'a, N, C, S> {
|
|||
command_runner: &'a C,
|
||||
}
|
||||
|
||||
impl<'a, N, C: CommandRunner, S> Dump<'a, N, C, S> {
|
||||
impl<'a, N, C, S> Dump<'a, N, C, S> {
|
||||
pub const fn new(db_name: N, storage: S, command_runner: &'a C) -> Self {
|
||||
Self {
|
||||
db_name,
|
||||
|
|
@ -20,7 +20,9 @@ impl<'a, N, C: CommandRunner, S> Dump<'a, N, C, S> {
|
|||
command_runner,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, N, C: CommandRunner, S> Dump<'a, N, C, S> {
|
||||
async fn run_sql(&self, sql: &str) -> Result<String, Box<dyn Error>> {
|
||||
let b = self
|
||||
.command_runner
|
||||
|
|
|
|||
|
|
@ -9,14 +9,16 @@ pub struct User<'a, U, C> {
|
|||
command_runner: &'a C,
|
||||
}
|
||||
|
||||
impl<'a, U: AsRef<str>, C: CommandRunner> User<'a, U, C> {
|
||||
impl<'a, U: AsRef<str>, C> User<'a, U, C> {
|
||||
pub const fn new(user_name: U, command_runner: &'a C) -> Self {
|
||||
Self {
|
||||
user_name,
|
||||
command_runner,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, U: AsRef<str>, C: CommandRunner> User<'a, U, C> {
|
||||
async fn run_sql(&self, sql: &str) -> Result<String, Box<dyn Error>> {
|
||||
let b = self
|
||||
.command_runner
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ use std::fmt;
|
|||
use std::path::Path;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Install<'a, T: AsRef<Path>, C: CommandRunner> {
|
||||
pub struct Install<'a, T: AsRef<Path>, C> {
|
||||
target: T,
|
||||
command_runner: &'a C,
|
||||
}
|
||||
|
||||
impl<'a, T: AsRef<Path>, C: CommandRunner> Install<'a, T, C> {
|
||||
impl<'a, T: AsRef<Path>, C> Install<'a, T, C> {
|
||||
pub const fn new(target: T, command_runner: &'a C) -> Self {
|
||||
Self {
|
||||
target,
|
||||
|
|
|
|||
|
|
@ -5,21 +5,23 @@ use std::error::Error;
|
|||
use std::fmt;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PostgreSQLDatabase<'a, N: AsRef<str>, S: AsRef<str>, C: CommandRunner> {
|
||||
pub struct PostgreSQLDatabase<'a, N, S, C> {
|
||||
name: N,
|
||||
seed_file: S,
|
||||
command_runner: &'a C,
|
||||
}
|
||||
|
||||
impl<'a, N: AsRef<str>, S: AsRef<str>, C: CommandRunner> PostgreSQLDatabase<'a, N, S, C> {
|
||||
impl<'a, N, S, C> PostgreSQLDatabase<'a, N, S, C> {
|
||||
pub const fn new(name: N, seed_file: S, command_runner: &'a C) -> Self {
|
||||
PostgreSQLDatabase {
|
||||
Self {
|
||||
name,
|
||||
seed_file,
|
||||
command_runner,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, N: AsRef<str>, S: AsRef<str>, C: CommandRunner> PostgreSQLDatabase<'a, N, S, C> {
|
||||
async fn run_sql(&self, sql: &str) -> Result<String, Box<dyn Error>> {
|
||||
let b = self
|
||||
.command_runner
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ pub struct Plugin<'a, P, N, R> {
|
|||
command_runner: &'a R,
|
||||
}
|
||||
|
||||
impl<'a, P: AsRef<Path>, N: AsRef<str>, R: CommandRunner> Plugin<'a, P, N, R> {
|
||||
impl<'a, P: AsRef<Path>, N: AsRef<str>, R> Plugin<'a, P, N, R> {
|
||||
pub const fn new(base: P, name: N, command_runner: &'a R) -> Self {
|
||||
Self {
|
||||
base,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ pub struct Translation<'a, C, D, R> {
|
|||
command_runner: &'a R,
|
||||
}
|
||||
|
||||
impl<'a, D, C: AsRef<str>, R: CommandRunner> Translation<'a, C, D, R> {
|
||||
impl<'a, D, C: AsRef<str>, R> Translation<'a, C, D, R> {
|
||||
pub const fn new(path: D, version: &'a str, locale: C, command_runner: &'a R) -> Self {
|
||||
Self {
|
||||
path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue