-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow eg. pkgx +rust
like pkgx^1 does
#1090
Conversation
This leaves old I chose to rename so as to avoid a DB query every time pkgx runs just to determine if we need to upgrade. Maybe this is retarded. Maybe it's genius. Who knows? |
04e0eb4
to
ec6927d
Compare
hmm it's just lucky (and probs wrong) that the display-name for rust is |
@@ -41,7 +41,7 @@ async fn main() -> Result<(), Box<dyn Error>> { | |||
|
|||
let cache_dir = config.pantry_dir.parent().unwrap(); | |||
std::fs::create_dir_all(cache_dir)?; | |||
let mut conn = Connection::open(cache_dir.join("pantry.db"))?; | |||
let mut conn = Connection::open(cache_dir.join("pantry.2.db"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i sense migrations coming. there's a fair few tools in rust for that. and a few in pkgx, like goose
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would certainly be more proper to be able to update the db incrementally and with migrations. That’s work I am not interested in RN tho for sure.
let mut rv = Vec::new(); | ||
let mut rows = stmt.query(params![symbol])?; | ||
while let Some(row) = rows.next()? { | ||
rv.push(row.get(0)?); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for style reasons, this is:
Ok(
stmt
.query(params![symbol])?
.map(|row| row.get(0).expect("Query returned malformed data."))
.collect::<Vec<String>
)
assuming the borrow checker doesn't think you're dropping bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't compile and I am not enough of a rust guru yet to fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you haven't, give pkgx bacon -j clippy
a try ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not, though I have been there numerous times lately since it is the latest addition to the pantry. I guess I don't see how it would help me here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not here specifically, but the feedback is rapid and, to my mind, better organized than rust-analyzer+vscode (it also works no matter what base directory you're in, which rust-analyzer struggles with).
ec6927d
to
c54c9f4
Compare
c54c9f4
to
33ed021
Compare
33ed021
to
f5ae8e6
Compare
No description provided.