Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
address PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
leops committed Oct 5, 2022
1 parent f1ab6bc commit 568655d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/rome_service/src/workspace/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ impl WorkspaceServer {
.ok_or_else(self.build_capability_error(rome_path))?;

/// Limit the size of files to 1.0 MiB
const SIZE_LIMIT: usize = 1024 * 1024;
const SIZE_LIMIT_IN_BYTES: usize = 1024 * 1024;

let size = document.content.as_bytes().len();
if size >= SIZE_LIMIT {
if size >= SIZE_LIMIT_IN_BYTES {
return Err(RomeError::FileTooLarge {
path: rome_path.to_path_buf(),
size,
limit: SIZE_LIMIT,
limit: SIZE_LIMIT_IN_BYTES,
});
}

Expand Down

0 comments on commit 568655d

Please sign in to comment.