[librsvg: 10/32] Remove LoadingError::NoDataPassedToParser
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 10/32] Remove LoadingError::NoDataPassedToParser
- Date: Fri, 4 Dec 2020 21:11:30 +0000 (UTC)
commit f64096fbf6cd3eccfc9debc7976d07ba246aaf02
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 25 12:55:45 2020 -0600
Remove LoadingError::NoDataPassedToParser
This was only for the C API, when the caller does handle_new() and
then handle_close() without an intermediate handle_write(). Now the
code returns an XmlParseError instead.
src/c_api/handle.rs | 4 +++-
src/error.rs | 4 ----
2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/c_api/handle.rs b/src/c_api/handle.rs
index 5af0d92a..5573f3cb 100644
--- a/src/c_api/handle.rs
+++ b/src/c_api/handle.rs
@@ -766,7 +766,9 @@ impl CHandle {
match *state {
LoadState::Start => {
*state = LoadState::ClosedError;
- Err(LoadingError::NoDataPassedToParser)
+ Err(LoadingError::XmlParseError(String::from(
+ "caller did not write any data",
+ )))
}
LoadState::Loading { ref buffer } => {
diff --git a/src/error.rs b/src/error.rs
index 7d4da25d..4a2915a0 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -312,9 +312,6 @@ impl From<HrefError> for ValueErrorKind {
/// all input/output.
#[derive(Debug, Clone)]
pub enum LoadingError {
- // FIXME: C API only
- NoDataPassedToParser,
-
/// XML syntax error.
XmlParseError(String),
@@ -360,7 +357,6 @@ impl error::Error for LoadingError {}
impl fmt::Display for LoadingError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
- LoadingError::NoDataPassedToParser => write!(f, "no data passed to parser"),
LoadingError::XmlParseError(ref s) => write!(f, "XML parse error: {}", s),
LoadingError::OutOfMemory(ref s) => write!(f, "out of memory: {}", s),
LoadingError::CouldNotCreateXmlParser => write!(f, "could not create XML parser"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]