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
serde_codegen missing some carraige returns #196
Comments
This was primarily to work around a serde_codegen bug: serde-rs/serde#196
Just ran into this today myself. Is this an issue in serde_codegen or in syntex? |
@mtdowling: I think this was supposed to be fixed in the latest syntex and serde_codegen. Which version are you on? |
This is happening to me using these versions:
Anyone have a workaround for this in the interim? |
Ugh, I was able to reproduce this. One workaround would be to use the /**
An uploaded file that was received as part of `multipart/form-data` parsing.
Files are streamed to disk because they may not fit in memory.
*/
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UploadedFile {
/// The temporary file where the data was saved.
pub path: PathBuf,
/// The filename that was specified in the data, unfiltered. It may or may not be legal on the
/// local filesystem.
pub filename: Option<String>,
/// The unvalidated content-type that was specified in the data.
pub content_type: Mime,
/// The size of the file.
pub size: usize,
// The temporary directory the upload was put into, saved for the Drop trait
tempdir: PathBuf,
} That still has the missing-newline, but it won't comment out critical code. |
Turns out this is a rust pretty printing bug that syntex inherited. |
Moving this bug over to serde-deprecated/syntex#31. |
`use serde;` leads to compilation error; `extern crate` is enough This PR fixes the compile error of `num-complex` that appears due to a redundant `use serde;` after `extern crate serde;` in the same module. To reproduce the error, just build `num-complex` with the feature `serde`, see below. ```zsh % cargo build --features serde Compiling num-complex v0.1.32 (file:///home/janis/github/num/complex) src/lib.rs:27:5: 27:10 error: an extern crate named `serde` has already been imported in this module [E0259] src/lib.rs:27 use serde; ^~~~~ src/lib.rs:19:1: 19:20 note: previous import of `serde` here src/lib.rs:19 extern crate serde; ^~~~~~~~~~~~~~~~~~~ src/lib.rs:27:5: 27:10 help: run `rustc --explain E0259` to see a detailed explanation error: aborting due to previous error error: Could not compile `num-complex`. ```
Fix import serde and rational deserialization Similar to serde-rs#196 for num/complex, “use serde;” needed to be removed in num/rational. Also, deserialization of `num/rational` needed to be fixed by adding type annotations. This is in response to rust-num/num#222 (comment) of issue rust-num/num#222. Also added a travis line, in response to rust-num/num#222 (comment). Hope it works.
This:
is turning into this:
Causing one of the derives to be commented out.
(serde_codegen 0.6.6, syntex 0.22.0)
Any sort of workaround would be appreciated.
The text was updated successfully, but these errors were encountered: