add rust analyzer to the shell
Some checks reported errors
Albatros default

This commit is contained in:
Quentin 2023-11-02 16:17:11 +01:00
parent a65f5b2589
commit bf67935c54
Signed by: quentin
GPG key ID: E9602264D639FF68
3 changed files with 9 additions and 13 deletions

View file

@ -58,10 +58,12 @@
buildInputs = [ buildInputs = [
cargo2nix.packages.x86_64-linux.default cargo2nix.packages.x86_64-linux.default
fenix.packages.x86_64-linux.minimal.toolchain fenix.packages.x86_64-linux.minimal.toolchain
fenix.packages.x86_64-linux.rust-analyzer
]; ];
shellHook = '' shellHook = ''
echo "AEROGRAME DEVELOPMENT SHELL ${fenix.packages.x86_64-linux.minimal.rustc}" echo "AEROGRAME DEVELOPMENT SHELL ${fenix.packages.x86_64-linux.minimal.rustc}"
export RUST_SRC_PATH="${fenix.packages.x86_64-linux.latest.rust-src}/lib/rustlib/src/rust/library" export RUST_SRC_PATH="${fenix.packages.x86_64-linux.latest.rust-src}/lib/rustlib/src/rust/library"
export RUST_ANALYZER_INTERNALS_DO_NOT_USE='this is unstable'
''; '';
}; };

View file

@ -198,7 +198,7 @@ async fn move_incoming_message(
// 2 parse mail and add to inbox // 2 parse mail and add to inbox
let msg = IMF::try_from(&plain_mail[..]).map_err(|_| anyhow!("Invalid email body"))?; let msg = IMF::try_from(&plain_mail[..]).map_err(|_| anyhow!("Invalid email body"))?;
inbox inbox
.append_from_s3(msg, id, &object_key, message_key) .append_from_s3(msg, id, object.to_ref(), message_key)
.await?; .await?;
// 3 delete from incoming // 3 delete from incoming

View file

@ -14,7 +14,7 @@ use crate::login::Credentials;
use crate::mail::uidindex::*; use crate::mail::uidindex::*;
use crate::mail::unique_ident::*; use crate::mail::unique_ident::*;
use crate::mail::IMF; use crate::mail::IMF;
use crate::storage::{RowStore, BlobStore}; use crate::storage::{RowStore, BlobStore, self};
use crate::time::now_msec; use crate::time::now_msec;
pub struct Mailbox { pub struct Mailbox {
@ -121,13 +121,13 @@ impl Mailbox {
&self, &self,
msg: IMF<'a>, msg: IMF<'a>,
ident: UniqueIdent, ident: UniqueIdent,
s3_key: &str, blob_ref: storage::BlobRef,
message_key: Key, message_key: Key,
) -> Result<()> { ) -> Result<()> {
self.mbox self.mbox
.write() .write()
.await .await
.append_from_s3(msg, ident, s3_key, message_key) .append_from_s3(msg, ident, blob_ref, message_key)
.await .await
} }
@ -348,20 +348,14 @@ impl MailboxInternal {
&mut self, &mut self,
mail: IMF<'a>, mail: IMF<'a>,
ident: UniqueIdent, ident: UniqueIdent,
s3_key: &str, blob_ref: storage::BlobRef,
message_key: Key, message_key: Key,
) -> Result<()> { ) -> Result<()> {
futures::try_join!( futures::try_join!(
async { async {
// Copy mail body from previous location // Copy mail body from previous location
let cor = CopyObjectRequest { let dst = self.s3.blob(format!("{}/{}", self.mail_path, ident));
bucket: self.bucket.clone(), blob_ref.copy(dst).await?;
key: format!("{}/{}", self.mail_path, ident),
copy_source: format!("{}/{}", self.bucket, s3_key),
metadata_directive: Some("REPLACE".into()),
..Default::default()
};
self.s3.copy_object(cor).await?;
Ok::<_, anyhow::Error>(()) Ok::<_, anyhow::Error>(())
}, },
async { async {