Skip to content

Commit

Permalink
Updating Cargo.toml files with rust-version
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed Mar 24, 2024
1 parent 493318e commit 629d48f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion njord/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "BSD-3-Clause"
documentation = "https://docs.rs/njord/latest/njord/"
repository = "https://github.com/mjovanc/njord"
readme = "crates-io.md"
rustc = "1.74.0"
rust-version = "1.74.0"

[dependencies]
njord_derive = { version = "0.1.0", optional = true, path = "../njord_derive" }
Expand Down
8 changes: 7 additions & 1 deletion njord/src/sqlite/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fs;
use std::path::{Path, PathBuf};

use rusqlite::{Connection, Error};
Expand All @@ -17,8 +18,13 @@ pub fn open(db_name: &str) -> Result<Connection, Error> {
PathBuf::from("../target")
});
let db_file_path = target_dir.join(db_name);
let full_db_file_path = match fs::canonicalize(&db_file_path) {
Ok(path) => path,
Err(_e) => return Err(Error::ExecuteReturnedResults),
};
println!("db_file_path = {:?}", full_db_file_path);

let conn = Connection::open(db_file_path)?;
let conn = Connection::open(full_db_file_path)?;

Ok(conn)
}
Expand Down
2 changes: 1 addition & 1 deletion njord_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0"
documentation = "https://docs.rs/njord/latest/njord/"
repository = "https://github.com/mjovanc/njord"
readme = "crates-io.md"
rustc = "1.74.0"
rust-version = "1.74.0"

[[bin]]
name = "njord"
Expand Down
2 changes: 1 addition & 1 deletion njord_cli/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn run(env: Option<&String>, log_level: Option<&String>) {
//TODO: this doesnt load since it looks in the wrong directory
// need to update the open() function to look for either ../target or ./target dir
// it should not be hardcoded here as well, we need a more elegant solution
let conn = sqlite::open("test_database.db");
let conn = sqlite::open("sqlite.db");

match conn {
Ok(conn) => {
Expand Down
2 changes: 1 addition & 1 deletion njord_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0"
documentation = "https://docs.rs/njord/latest/njord/"
repository = "https://github.com/mjovanc/njord"
readme = "crates-io.md"
rustc = "1.74.0"
rust-version = "1.74.0"

[lib]
name = "njord_derive"
Expand Down

0 comments on commit 629d48f

Please sign in to comment.