mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Tweak whitespace around use statements and other lint fixes
This commit is contained in:
@@ -78,10 +78,10 @@ impl DocumentMessageHandler {
|
||||
let deserialized_result: Result<Self, DocumentError> = serde_json::from_str(serialized_content).map_err(|e| DocumentError::InvalidFile(e.to_string()));
|
||||
match deserialized_result {
|
||||
Ok(document) => {
|
||||
if document.version != GRAPHITE_DOCUMENT_VERSION {
|
||||
Err(DocumentError::InvalidFile("Graphite document version mismatch".to_string()))
|
||||
} else {
|
||||
if document.version == GRAPHITE_DOCUMENT_VERSION {
|
||||
Ok(document)
|
||||
} else {
|
||||
Err(DocumentError::InvalidFile("Graphite document version mismatch".to_string()))
|
||||
}
|
||||
}
|
||||
Err(e) => Err(e),
|
||||
@@ -440,6 +440,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessorMessageHandler> for Docum
|
||||
#[remain::check]
|
||||
fn process_action(&mut self, message: DocumentMessage, ipp: &InputPreprocessorMessageHandler, responses: &mut VecDeque<Message>) {
|
||||
use DocumentMessage::*;
|
||||
|
||||
#[remain::sorted]
|
||||
match message {
|
||||
AbortTransaction => {
|
||||
@@ -585,7 +586,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessorMessageHandler> for Docum
|
||||
}
|
||||
ExportDocument => {
|
||||
// TODO(MFISH33): Add Dialog to select artboards
|
||||
let bbox = self.document_bounds().unwrap_or([DVec2::ZERO, ipp.viewport_bounds.size()]);
|
||||
let bbox = self.document_bounds().unwrap_or_else(|| [DVec2::ZERO, ipp.viewport_bounds.size()]);
|
||||
let size = bbox[1] - bbox[0];
|
||||
let name = match self.name.ends_with(FILE_SAVE_SUFFIX) {
|
||||
true => self.name.clone().replace(FILE_SAVE_SUFFIX, FILE_EXPORT_SUFFIX),
|
||||
|
||||
Reference in New Issue
Block a user