forked from TWS/kalkutago
Remove no-longer-existing Rust feature default_free_fn
This commit is contained in:
parent
01004e237b
commit
b4d524dccb
9
server/shell.nix
Normal file
9
server/shell.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# DEVELOPMENT shell environment
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
pkgs.mkShell {
|
||||||
|
nativeBuildInputs = with pkgs.buildPackages; [
|
||||||
|
clang
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ mod tracks;
|
||||||
pub(crate) mod update;
|
pub(crate) mod update;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
default::default,
|
default::Default,
|
||||||
env, fs,
|
env, fs,
|
||||||
net::{IpAddr, Ipv4Addr},
|
net::{IpAddr, Ipv4Addr},
|
||||||
};
|
};
|
||||||
|
@ -83,7 +83,7 @@ pub(crate) fn start_server(db: DatabaseConnection) -> Rocket<Build> {
|
||||||
.configure(Config {
|
.configure(Config {
|
||||||
address: IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
|
address: IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
|
||||||
secret_key: SecretKey::derive_from(&get_secret()),
|
secret_key: SecretKey::derive_from(&get_secret()),
|
||||||
..default()
|
..Config::default()
|
||||||
})
|
})
|
||||||
.register("/", catchers![spa_index_redirect])
|
.register("/", catchers![spa_index_redirect])
|
||||||
.manage(db)
|
.manage(db)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use std::{
|
use std::{
|
||||||
default::default,
|
|
||||||
env,
|
env,
|
||||||
ffi::{OsStr, OsString},
|
ffi::{OsStr, OsString},
|
||||||
fs::File,
|
fs::File,
|
||||||
|
@ -30,7 +29,7 @@ fn get_env_var_or_file<A: AsRef<OsStr>>(key: A) -> Option<String> {
|
||||||
if let Some(path) = env::var_os(file_key) {
|
if let Some(path) = env::var_os(file_key) {
|
||||||
// open the file and read it
|
// open the file and read it
|
||||||
let mut file = File::open(&path).unwrap_or_else(|_| panic!("no such file at {path:?}"));
|
let mut file = File::open(&path).unwrap_or_else(|_| panic!("no such file at {path:?}"));
|
||||||
let mut val: String = default();
|
let mut val = String::new();
|
||||||
file.read_to_string(&mut val)
|
file.read_to_string(&mut val)
|
||||||
.unwrap_or_else(|_| panic!("reading file at {path:?}"));
|
.unwrap_or_else(|_| panic!("reading file at {path:?}"));
|
||||||
Some(val)
|
Some(val)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
|
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
|
||||||
|
|
||||||
use std::default::default;
|
use std::default::Default;
|
||||||
|
|
||||||
use chrono::{Datelike, Timelike, Utc};
|
use chrono::{Datelike, Timelike, Utc};
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
@ -60,7 +60,7 @@ impl ActiveModel {
|
||||||
minute: Set(now.minute().try_into().ok()),
|
minute: Set(now.minute().try_into().ok()),
|
||||||
second: Set(now.second().try_into().ok()),
|
second: Set(now.second().try_into().ok()),
|
||||||
has_time_info: Set(Some(1)),
|
has_time_info: Set(Some(1)),
|
||||||
..default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub(crate) fn on(date: Date, track_id: i32) -> Self {
|
pub(crate) fn on(date: Date, track_id: i32) -> Self {
|
||||||
|
@ -80,7 +80,7 @@ impl ActiveModel {
|
||||||
minute: Set(now.minute().try_into().ok()),
|
minute: Set(now.minute().try_into().ok()),
|
||||||
second: Set(now.second().try_into().ok()),
|
second: Set(now.second().try_into().ok()),
|
||||||
has_time_info: Set(Some(1)),
|
has_time_info: Set(Some(1)),
|
||||||
..default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
|
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
|
||||||
|
|
||||||
use std::default::default;
|
use std::default::Default;
|
||||||
|
|
||||||
use bcrypt::*;
|
use bcrypt::*;
|
||||||
// TODO Add option for argon2 https://docs.rs/argon2/latest/argon2/
|
// TODO Add option for argon2 https://docs.rs/argon2/latest/argon2/
|
||||||
|
@ -57,7 +57,7 @@ impl ActiveModel {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
name,
|
name,
|
||||||
password_hash,
|
password_hash,
|
||||||
..default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(default_free_fn, proc_macro_hygiene, decl_macro, never_type)]
|
#![feature(proc_macro_hygiene, decl_macro, never_type)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rocket;
|
extern crate rocket;
|
||||||
mod api;
|
mod api;
|
||||||
|
|
Loading…
Reference in a new issue