1
0
Fork 0
forked from TWS/kalkutago

Remove no-longer-existing Rust feature default_free_fn

This commit is contained in:
D. Scott Boggs 2023-07-20 07:39:46 -04:00
parent 01004e237b
commit b4d524dccb
6 changed files with 18 additions and 10 deletions

9
server/shell.nix Normal file
View file

@ -0,0 +1,9 @@
# DEVELOPMENT shell environment
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages; [
clang
];
}

View file

@ -8,7 +8,7 @@ mod tracks;
pub(crate) mod update;
use std::{
default::default,
default::Default,
env, fs,
net::{IpAddr, Ipv4Addr},
};
@ -83,7 +83,7 @@ pub(crate) fn start_server(db: DatabaseConnection) -> Rocket<Build> {
.configure(Config {
address: IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
secret_key: SecretKey::derive_from(&get_secret()),
..default()
..Config::default()
})
.register("/", catchers![spa_index_redirect])
.manage(db)

View file

@ -1,5 +1,4 @@
use std::{
default::default,
env,
ffi::{OsStr, OsString},
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) {
// open the file and read it
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)
.unwrap_or_else(|_| panic!("reading file at {path:?}"));
Some(val)

View file

@ -1,6 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use std::default::default;
use std::default::Default;
use chrono::{Datelike, Timelike, Utc};
use sea_orm::entity::prelude::*;
@ -60,7 +60,7 @@ impl ActiveModel {
minute: Set(now.minute().try_into().ok()),
second: Set(now.second().try_into().ok()),
has_time_info: Set(Some(1)),
..default()
..Default::default()
}
}
pub(crate) fn on(date: Date, track_id: i32) -> Self {
@ -80,7 +80,7 @@ impl ActiveModel {
minute: Set(now.minute().try_into().ok()),
second: Set(now.second().try_into().ok()),
has_time_info: Set(Some(1)),
..default()
..Default::default()
}
}
}

View file

@ -1,6 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use std::default::default;
use std::default::Default;
use bcrypt::*;
// TODO Add option for argon2 https://docs.rs/argon2/latest/argon2/
@ -57,7 +57,7 @@ impl ActiveModel {
Ok(Self {
name,
password_hash,
..default()
..Default::default()
})
}
}

View file

@ -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]
extern crate rocket;
mod api;