Initial commit

This commit is contained in:
asonix 2024-05-03 11:56:02 -05:00
commit 0d089e1b8d
3 changed files with 57 additions and 0 deletions

8
Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "tokio-postgres-generic-rustls"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

35
flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
description = "tokio-postgres-generic-rustls";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
packages.default = pkgs.hello;
devShell = with pkgs; mkShell {
nativeBuildInputs = [
cargo
cargo-outdated
clippy
diesel-cli
rust-analyzer
rustc
rustfmt
stdenv.cc
taplo
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
});
}

14
src/lib.rs Normal file
View file

@ -0,0 +1,14 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}